/* ==========================================
   TEAM PAGE
   ========================================== */

/* Team Header (league-parity banner) */
.team-page-header {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-card);
    border-radius: 16px;
    max-width: var(--container-max-width);
    margin: 16px auto 0;
    width: calc(100% - 24px);
}

/* Stadium backdrop (shared league-header-bg.jpg); absolute layer so the
   layout degrades gracefully when the image is missing. */
.team-header-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Purple gradient overlay above the backdrop */
.team-page-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(30deg, rgba(13, 0, 30, 1) 0%, rgba(13, 0, 30, 0.27) 100%);
    pointer-events: none;
}

.team-header-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 28px;
}

.team-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.team-header-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-header-titles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.team-page-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2em;
    color: var(--text-white);
    margin-bottom: 0;
}

.team-page-country {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.22em;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.team-country-flag {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.team-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* Follow button — purple pill (36px / radius 40px) */
.team-follow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 8px 18px;
    background: var(--accent-purple);
    border: none;
    border-radius: 40px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text-white);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-fast);
}

.team-follow-btn:hover {
    filter: brightness(1.15);
}

.team-follow-btn.following {
    /* background: var(--bg-card-header); */
}

/* Team Tabs — sticky rounded floating bar */
.team-tabs {
    position: sticky;
    top: var(--header-height);
    z-index: 99;
    display: flex;
    align-items: stretch;
    height: 50px;
    padding: 0 16px;
    background: var(--bg-card);
    border-radius: 16px;
    max-width: var(--container-max-width);
    margin: 16px auto 0;
    width: calc(100% - 24px);
}

.team-tabs-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.team-tabs-container::-webkit-scrollbar {
    display: none;
}

.team-tab {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1.22em;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-fast);
}

.team-tab:hover {
    color: var(--text-primary);
}

.team-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Matches is a mobile-only tab: above the stacking breakpoint the fixtures
   aside is a persistent column, so this tab has nothing to switch to. */
.team-tab[data-tab="matches"] {
    display: none;
}

/* No fixtures at all -> no desktop column, exactly as when the aside used to
   be skipped server-side. Mobile still shows it (see the 991.98px block).
   Compound selector: must outrank `.team-fixtures-side { display: flex }`,
   which is declared further down at the same specificity. */
.team-fixtures-side.team-fixtures-side--empty {
    display: none;
}

/* Team Content */
.team-content {    
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 24px 0px;
    width: calc(100% - 24px);
}

.team-tab-pane {
    display: none;
}

.team-tab-pane.active {
    display: block;
}

/* ═══ Page Layout — persistent fixtures side + tabbed main side ═══
   Mirrors league.php/.league-layout: the matches panel lives OUTSIDE the
   tab panes so switching tabs only swaps the main side while fixtures stay. */
.team-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.team-fixtures-side {
    width: 481px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.team-main-side {
    flex: 1;
    min-width: 0;
}

/* Standings tab card (kept for the Standings pane) */
.team-fixtures-section {
    background: var(--bg-card);
    border-radius: var(--border-radius-card);
    padding: 16px;
    margin-bottom: 16px;
}

.team-section-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Standings controls layout */
.team-standings-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

/* Standings league pill tabs (player-comp-tabs parity) */
.team-comp-tabs {
    display: flex;
    align-items: stretch;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.team-comp-tabs::-webkit-scrollbar {
    display: none;
}

.team-comp-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1.22;
    white-space: nowrap;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.team-comp-tab:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.team-comp-tab.active {
    color: var(--text-primary);
    background: transparent;
    border-color: var(--accent-purple);
}

.team-comp-tab img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Standings All/Home/Away filter — pill style (old team-comp-tab look), full-width */
#team-tab-standings .standings-filters {
    display: flex;
    gap: 6px;
    width: 100%;
    margin-bottom: 16px;
    border-bottom: none;
}

#team-tab-standings .standings-filter-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1.22;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    cursor: pointer;
    transition: var(--transition-fast);
}

#team-tab-standings .standings-filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

#team-tab-standings .standings-filter-btn.active {
    color: var(--text-white);
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

/* ═══ Fixtures cards (sidebar) — league-parity card + compact rows ═══ */
.team-fixtures-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-card);
    overflow: hidden;
}

.team-fixtures-card-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 12px 16px;
    background: var(--bg-card-header);
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    font-weight: 700;
    line-height: 1.43em;
    color: var(--text-primary);
}

/* Competition + date band above each fixture row */
.team-fixtures-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 16px;
    background: var(--border-color);
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.team-fixtures-comp {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-tertiary);
}

.team-fixtures-date {
    flex-shrink: 0;
}

/* Match row: home | center | away */
.team-fixture-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    min-height: 70px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

.team-fixtures-group:last-child .team-fixture-item {
    border-bottom: none;
}

.team-fixture-item:hover {
    background: var(--bg-card-hover);
}

.team-fixture-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    min-width: 0;
    flex: 1 1 0;
}

.team-fixture-team.home {
    justify-content: flex-end;
}

.team-fixture-team.away {
    justify-content: flex-start;
}

.team-fixture-team img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-fixture-team-name {
    min-width: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-fixture-team.away .team-fixture-team-name {
    flex: 1;
}

.team-fixture-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 120px;
    padding: 2px 0;
}

.team-fixture-score {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.22em;
    color: var(--text-primary);
}

.team-fixture-time {
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--text-secondary);
}

.team-fixture-status-label {
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text-secondary);
}

/* Live row tint + score */
.team-fixture-live {
    background: var(--match-live-bg);
}

.team-fixture-live:hover {
    background: var(--accent-red-bg);
}

.team-fixture-score-live {
    color: var(--color-live);
    animation: pulse 1.5s infinite;
}

.team-fixture-suspended {
    color: var(--accent-red);
}

.team-fixture-minute-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--accent-red-bg);
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-red);
}

.team-fixture-minute-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--accent-red);
    animation: pulse 1.5s infinite;
}

.live-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--color-live);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* W/D/L result chip (results list) */
.team-match-result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-white);
}
.team-match-result.W { background: var(--accent-green); }
.team-match-result.D { background: #ff8c00; }
.team-match-result.L { background: var(--accent-red); }

.penalty-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: 0.75rem;
    /* color: #f0ad4e; */
    margin-top: 3px;
    line-height: 1.2;
}

.penalty-badge .pen-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.8;
}

.penalty-badge .pen-score {
    font-weight: 600;
}

/* Load-more button inside a fixtures card */
.team-fixtures-card > .load-more-btn {
    display: block;
    width: auto;
    margin: 12px 16px 16px;
}

/* ═══ Team News — reuses the shared .news-featured component (style.css),
   identical grid structure and card styling to league.php.
   Grid: 2-column with first card spanning full width (featured).
   ═══ */
.league-news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Neutralize responsive.css flex-basis hints inside the grid */
.league-news-grid .news-featured {
    min-width: 0;
}

.league-news-grid .news-featured:first-child {
    grid-column: 1 / -1;
}

/* Deep-purple brand fallback under the article image
   (Figma fill_21SQ3X gradient base #2D0054) */
.league-news-grid .news-featured-bg {
    background-color: var(--bg-footer);
}

/* Meta row — clock icon + date (Figma Component 8: gap 6px,
   Body/Sm Medium 12, #81797C) */
.league-news-grid .news-featured-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.league-news-grid .news-featured-meta i {
    font-size: var(--font-size-md);
    line-height: 1;
}

/* Standings styles (table, zones, highlight, form) now live in the shared
   assets/css/standings.css — single source used by the match-detail, league
   and team standings renderer. */

/* Players Tab — lime left-bar group titles + full-width row cards */
.team-squad-group {
    margin-bottom: 24px;
}

/* Lime left-bar group title (shared by Players + Info sections) */
.team-group-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-md);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-inline-start: 12px;
    border-inline-start: 3px solid var(--accent-primary);
}

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

.team-player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.team-player-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.team-player-photo {
    width: 44px;
    height: 44px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-card-header);
}

/* Purple shirt-number badge sitting next to the photo */
.team-player-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background: var(--accent-purple);
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text-white);
}

.team-player-info {
    flex: 1;
    min-width: 0;
}

.team-player-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-player-position {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}

.team-player-meta {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    text-align: end;
    white-space: nowrap;
}

/* Video Tab */
.team-video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.team-video-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: var(--transition-fast);
}

.team-video-card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

.team-video-thumb {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.team-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 20px;
}

.team-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-white);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.team-video-body {
    padding: 12px;
}

.team-video-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.team-video-date {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* Info Tab — three lime left-bar sections */
.team-info-tab {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* (1) Historical Achievements — 3-per-row cards */
.team-achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.team-achievement-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.team-achievement-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.team-achievement-icon {
    font-size: 24px;
    line-height: 1;
    color: var(--accent-primary);
}

.team-achievement-count {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-primary);
}

.team-achievement-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.team-achievement-sub {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: 10px;
}

.team-achievement-link {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
}

.team-achievement-link:hover {
    text-decoration: underline;
}

/* (2) Club Information — single card, 4-column icon row */
.team-club-info-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.team-club-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.team-club-info-item > i {
    font-size: 20px;
    line-height: 1.2;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.team-club-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.team-club-info-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.team-club-info-value {
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text-primary);
}

/* (3) About the Club — single paragraph card */
.team-about-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.team-about-card p {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.7;
    color: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 1199.98px) {
    .team-fixtures-side {
        width: 400px;
    }
}

@media (max-width: 991.98px) {
    /* Stack the layout: fixtures side becomes full width and turns into the
       pane of the Matches tab instead of showing above every other tab. */
    .team-layout {
        flex-direction: column;
    }
    .team-fixtures-side,
    .team-main-side {
        width: 100%;
    }
    .team-tab[data-tab="matches"] {
        display: flex;
    }
    .team-fixtures-side.team-fixtures-side--empty {
        display: flex;
    }
    /* Aside and panes are mutually exclusive here. team.js mirrors the active
       tab onto [data-active-tab]; without that attribute (script disabled /
       not yet run) both stay visible, i.e. the previous stacked behaviour, so
       content is never lost. */
    .team-layout[data-active-tab="matches"] .team-main-side {
        display: none;
    }
    .team-layout[data-active-tab]:not([data-active-tab="matches"]) .team-fixtures-side {
        display: none;
    }
    .team-achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .team-club-info-card {
        grid-template-columns: repeat(2, 1fr);
    }
    .team-video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .league-news-grid {
        grid-template-columns: 1fr;
    }
    .team-header-container {
        padding: 24px 20px;
    }
    .team-header-logo {
        width: 56px;
        height: 56px;
    }
    .team-page-name {
        font-size: 18px;
    }
    
    .team-fixture-item {
        padding: 8px 12px;
    }
    .team-fixture-center {
        min-width: 96px;
    }
}

@media (max-width: 575.98px) {
    .team-header-container {
        flex-direction: row;
        align-items: center;
        padding: 20px 16px;
    }
    .team-header-logo {
        width: 48px;
        height: 48px;
    }
    .team-page-name {
        font-size: 16px;
    }
    .team-tabs {
        padding: 0 8px;
    }
    .team-tabs-container {
        justify-content: flex-start;
        padding: 0 8px;
    }
    .team-tab {
        padding: 12px 14px;
        font-size: var(--font-size-xs);
    }
    .team-achievements-grid {
        grid-template-columns: 1fr;
    }
    .team-club-info-card {
        grid-template-columns: 1fr;
    }
    .team-video-grid {
        grid-template-columns: 1fr;
    }
}

/* Load More Button */
.load-more-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    margin-top: 12px;
    margin-inline-end: auto !important;
    margin-inline-start: auto !important;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.load-more-btn:hover {
    background: var(--accent-teal);
    border-color: var(--accent-teal);
    color: var(--text-on-accent);
}
.load-more-btn .load-more-count {
    opacity: 0.7;
    font-size: 0.85em;
    margin-inline-start: 4px;
}

/* ==========================================
   TEAM LINEUP TAB
   ========================================== */

.team-lineup-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px 0;
}

.team-lineup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 8px;
}

.team-lineup-formation {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-on-accent);
    background: var(--accent-teal);
    padding: 6px 14px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.team-lineup-coach {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.team-lineup-coach img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.team-lineup-coach a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.15s;
}

.team-lineup-coach a:hover {
    opacity: 0.8;
    /* text-decoration: underline; */
}

.team-lineup-pitch {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 340 / 520;
    border-radius: 8px;
    overflow: visible;
    padding: 4px;
}

.team-lineup-pitch .pitch-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.team-lineup-pitch .pitch-player {
    position: absolute;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    width: 56px;
    padding: 3px;
    transition: transform 0.18s ease;
}

.team-lineup-pitch .pitch-player:hover {
    z-index: 50;
    transform: translate(-50%, -50%) scale(1.08);
}

.team-lineup-pitch .pitch-player-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(79, 195, 247, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 3px 10px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.15);
}

.team-lineup-pitch .pp-num {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.team-lineup-pitch .pitch-player-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-white);
    margin-top: 3px;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 64px;
    margin-inline-start: auto;
    margin-inline-end: auto;
}

.team-lineup-pitch .pitch-badge {
    position: absolute;
    z-index: 3;
}

.team-lineup-pitch .pitch-badge-number {
    right: 0;
    top: 2px;
    background: #111;
    color: var(--text-white);
    font-size: 0.58rem;
    font-weight: 800;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.5px solid rgba(255,255,255,0.55);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Substitutes */
.team-lineup-subs {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.team-lineup-subs-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-lineup-subs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.team-lineup-sub-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.15s ease;
}

.team-lineup-sub-card:hover {
    border-color: var(--accent-teal);
}

.team-lineup-sub-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.team-lineup-sub-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-lineup-sub-pos {
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* ==========================================
   PITCH PLAYER REDESIGN (team lineup pitch)
   Mirrors the match-detail pitch-player look:
   white photo ring + name pill with attached
   number pill. Scoped to .team-lineup-pitch.
   ========================================== */

.team-lineup-pitch .pitch-player-photo-wrap {
    position: relative;
    width: 42px;
    margin: 0 auto;
}

.team-lineup-pitch .pitch-player-img {
    border: 2.5px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

.team-lineup-pitch .pitch-player-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
}

.team-lineup-pitch .pitch-player-name {
    background: var(--bg-footer);
    color: var(--text-white);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 3px 9px;
    border-radius: var(--border-radius-pill);
    margin: 0;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.team-lineup-pitch .pitch-player-num {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--bg-topbar);
    color: var(--text-white);
    font-size: 0.55rem;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: -6px;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.25);
}

@media (max-width: 767.98px) {
    .team-lineup-pitch .pitch-player-photo-wrap {
        width: 34px;
    }

    .team-lineup-pitch .pitch-player-img {
        width: 34px;
        height: 34px;
    }

    .team-lineup-pitch .pitch-player-tag {
        margin-top: 3px;
    }

    .team-lineup-pitch .pitch-player-name {
        font-size: 0.52rem;
        padding: 2px 7px;
        max-width: 44px;
    }

    .team-lineup-pitch .pitch-player-num {
        width: 14px;
        height: 14px;
        font-size: 0.48rem;
        margin-inline-start: -5px;
    }

    .team-lineup-pitch .pp-num {
        font-size: 0.7rem;
    }
}

@media (max-width: 479.98px) {
    .team-lineup-pitch .pitch-player-photo-wrap {
        width: 30px;
    }

    .team-lineup-pitch .pitch-player-img {
        width: 30px;
        height: 30px;
    }

    .team-lineup-pitch .pitch-player-name {
        font-size: 0.48rem;
        padding: 2px 6px;
        max-width: 40px;
    }

    .team-lineup-pitch .pitch-player-num {
        width: 12px;
        height: 12px;
        font-size: 0.42rem;
        margin-inline-start: -4px;
    }
}
