/* Match the player profile's compact banner and quiet, full-width cards. */
#team-profile.profile-refresh {
    --profile-ink: #192b43;
    --profile-muted: #526176;
    --profile-line: #e1e7ef;
    --profile-tint: color-mix(in srgb, var(--team-primary, #173758) 7%, white);
    gap: var(--home-gap, 20px) !important;
    min-width: 0;
}
#team-profile.profile-refresh [data-testid="hero-banner"] {
    display: block !important;
    height: auto !important;
    min-height: 220px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 18px;
    overflow: hidden !important;
    /* Keep white banner text readable for the brightest club colours too. */
    background: color-mix(in srgb, var(--team-primary, #173758) 55%, #000);
}
#team-profile.profile-refresh .hero-background { background: none; }
#team-profile.profile-refresh [data-testid="hero-banner"] .hero-content {
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 0;
    width: 100%;
    height: auto !important;
    min-height: 220px !important;
    padding: 0 26px !important;
}
#team-profile.profile-refresh [data-testid="hero-banner"] .team-header {
    position: static !important;
    display: grid !important;
    grid-template-columns: 160px minmax(0, 1fr);
    align-items: center !important;
    flex: 1;
    gap: 24px !important;
    width: 100%;
    height: auto !important;
    min-height: 174px !important;
    padding: 22px 0 16px;
}
#team-profile.profile-refresh .team-logo-container {
    position: absolute;
    left: 26px;
    bottom: 0;
    display: grid;
    place-items: center;
    width: 160px;
    height: 220px;
    max-width: 100%;
    margin: 0;
    align-self: center !important;
}
#team-profile.profile-refresh .team-header .team-logo {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    object-position: center bottom;
    filter: none;
    border: 0;
    border-radius: 0;
    background: transparent;
}
#team-profile.profile-refresh .team-header .team-logo[hidden] { display: none !important; }
#team-profile.profile-refresh [data-testid="hero-banner"] [data-testid="banner-text"] {
    grid-column: 2;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    min-width: 0;
    padding: 0 !important;
    margin: 0 !important;
    align-items: stretch !important;
    align-self: center !important;
    text-align: left !important;
}
#team-profile.profile-refresh [data-testid="hero-banner"].team-identity-no-art .team-header { grid-template-columns: minmax(0,1fr) !important; }
#team-profile.profile-refresh .team-identity-no-art [data-testid="banner-text"] { grid-column: 1; }
#team-profile.profile-refresh .team-identity-no-art [data-testid="tabs-menu"] { margin-left: 0 !important; }
#team-profile.profile-refresh [data-testid="hero-banner"] .team-title-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    min-width: 0;
    padding-right: 92px;
}
#team-profile.profile-refresh .team-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    min-width: 0;
}
#team-profile.profile-refresh [data-testid="hero-banner"] .team-name {
    font-size: clamp(1.55rem, 2.6vw, 2.1rem) !important;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.16 !important;
    text-align: left !important;
    color: #fff !important;
    text-shadow: none;
    margin: 0 !important;
    overflow-wrap: anywhere;
}
#team-profile.profile-refresh .team-season-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 12px;
    background: #fff;
    color: var(--profile-ink);
    font-size: .81rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
#team-profile.profile-refresh [data-testid="hero-banner"] .team-meta-info {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px 14px !important;
    padding: 0 !important;
    margin: 0 !important;
    white-space: normal !important;
    opacity: 1;
}
#team-profile.profile-refresh [data-testid="hero-banner"] .team-meta-info .meta-item,
#team-profile.profile-refresh [data-testid="hero-banner"] .team-meta-info .meta-item :is(span,i) {
    font-size: .82rem !important;
    line-height: 1.5 !important;
    color: #fff !important;
    opacity: 1;
}
#team-profile.profile-refresh [data-testid="hero-banner"] .quick-stats {
    display: flex !important;
    flex-wrap: wrap;
    gap: 26px !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
    align-self: flex-start;
}
#team-profile.profile-refresh .quick-stats .stat-item { display: flex; flex-direction: column-reverse; text-align: left; }
#team-profile.profile-refresh [data-testid="hero-banner"] .quick-stats .stat-value { font-size: 1.45rem !important; line-height: 1.2; text-shadow: none; }
#team-profile.profile-refresh [data-testid="hero-banner"] .quick-stats .stat-label { font-size: .68rem !important; line-height: 1.4; letter-spacing: .055em; margin: 3px 0 0; opacity: 1; }

#team-profile.profile-refresh [data-testid="tabs-menu"] {
    min-width: 0;
    width: auto;
    margin: auto 0 0 184px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
#team-profile.profile-refresh [data-testid="tabs-menu"]::before,
#team-profile.profile-refresh [data-testid="player-tabs"]::before { content: none !important; }
#team-profile.profile-refresh [data-testid="tabs-menu"] .profile-nav {
    display: flex !important;
    align-items: stretch !important;
    gap: 2px !important;
    width: 100% !important;
    min-height: 46px;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin !important;
    scrollbar-color: #ffffff80 transparent;
    scroll-padding-inline: 8px;
    overscroll-behavior-x: contain;
}
#team-profile.profile-refresh [data-testid="tabs-menu"] .profile-nav .nav-tab {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 0;
    min-height: 46px !important;
    padding: 12px 15px !important;
    border: 0 !important;
    border-radius: 12px 12px 0 0 !important;
    background: transparent !important;
    color: #fff !important;
    font-size: .84rem !important;
    font-weight: 650;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: none !important;
    text-overflow: clip;
    overflow: visible;
    transform: none !important;
}
#team-profile.profile-refresh [data-testid="tabs-menu"] .profile-nav .nav-tab:hover { background: #00000018 !important; }
#team-profile.profile-refresh [data-testid="tabs-menu"] .profile-nav .nav-tab.active { background: #fff !important; color: var(--profile-ink) !important; }
#team-profile.profile-refresh .nav-tab::after { content: none !important; }
#team-profile.profile-refresh [data-testid="tabs-more-indicator"],
#team-profile.profile-refresh .profile-tab-mobile { display: none !important; }
#team-profile.profile-refresh [data-testid="bookmark-btn"] { min-width: 44px !important; min-height: 44px !important; top: 10px !important; right: 10px !important; background: #00000018 !important; color: #fff !important; }
#team-profile.profile-refresh [data-testid="bookmark-btn"]:hover { background: #00000030 !important; }
#team-profile.profile-refresh :is(button, a, select, input, [tabindex]):focus-visible { outline: 3px solid #2975c5 !important; outline-offset: 3px; }
#team-profile.profile-refresh [data-testid="hero-banner"] :is(button,a):focus-visible { outline: 2px solid #fff !important; outline-offset: -4px; }
#team-profile.profile-refresh [data-testid="hero-banner"] .nav-tab.active:focus-visible { outline-color: var(--profile-ink) !important; }

#team-profile.profile-refresh .tab-content { min-width: 0; width: 100%; max-width: none; margin: 0 !important; padding: 0 !important; }
#team-profile.profile-refresh :is(.content-card,.game-log-container) { min-width: 0; width: 100%; max-width: none; border: 1px solid var(--profile-line); border-radius: 16px; padding: 24px; margin: 0 0 20px; box-shadow: 0 2px 7px #192b4305; }
#team-profile.profile-refresh :is(.content-card,.game-log-container):hover { transform: none; box-shadow: 0 2px 7px #192b4305; }
#team-profile.profile-refresh :is(.content-card,.game-log-container)::before { content: none !important; }
#team-profile.profile-refresh .content-card .card-header,
#team-profile.profile-refresh .game-log-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 0 0 15px; margin: 0 0 18px; border-bottom: 1px solid var(--profile-line); background: transparent; }
#team-profile.profile-refresh .card-header > span,
#team-profile.profile-refresh .game-log-title { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: var(--profile-ink); font-size: 1.05rem !important; font-weight: 700; line-height: 1.35; letter-spacing: -.018em; }
#team-profile.profile-refresh :is(.card-icon,.game-log-title > i) { display: inline-grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px; color: var(--profile-ink); background: var(--profile-tint); font-size: .87rem !important; }
#team-profile.profile-refresh .team-overview-copy { max-width: 86ch; margin: 0; font-size: .95rem; line-height: 1.85; color: var(--profile-ink); }
#team-profile.profile-refresh #overview .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#team-profile.profile-refresh #overview .grid-stat { text-align: left; border: 1px solid var(--profile-line); border-radius: 12px; background: #f8fafc; padding: 16px; }
#team-profile.profile-refresh #overview .grid-stat-value { font-size: 1.6rem; line-height: 1.2; color: var(--profile-ink); }
#team-profile.profile-refresh #overview .grid-stat-label { font-size: .68rem; letter-spacing: .055em; color: var(--profile-muted); margin-top: 6px; line-height: 1.5; }
#team-profile.profile-refresh .leader-card { border: 1px solid var(--profile-line); border-radius: 12px; background: #fff; box-shadow: none; }
#team-profile.profile-refresh .leader-card:hover { transform: none; background: #f8fafc; border-color: #9ba9bb; box-shadow: none; }
#team-profile.profile-refresh .leader-name,
#team-profile.profile-refresh .leader-value { color: var(--profile-ink); }
#team-profile.profile-refresh .leader-stat { color: var(--profile-muted); }
#team-profile.profile-refresh .season-selector { margin-left: auto; }
#team-profile.profile-refresh .season-button { min-height: 44px; padding: 9px 14px; background: #fff; border: 1px solid var(--profile-line); border-radius: 10px; color: var(--profile-ink); font-size: .85rem; }
#team-profile.profile-refresh .season-button.active { background: #fff; color: var(--profile-ink); border-color: var(--profile-line); }
#team-profile.profile-refresh .season-button:hover { transform: none; border-color: var(--profile-ink); }
#team-profile.profile-refresh .season-dropdown { min-width: 104px; max-height: 240px; border: 1px solid var(--profile-line); box-shadow: 0 8px 24px #192b4320; }
#team-profile.profile-refresh .season-option { min-height: 40px; }
#team-profile.profile-refresh .content-card:has(.season-selector) { overflow: visible; }
#team-profile.profile-refresh :is(.stats-table-scroll-wrap,.stats-table-scroll) { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
#team-profile.profile-refresh .game-log-filters { min-width: 0; flex-wrap: wrap; }
#team-profile.profile-refresh :is(.filter-select,.profile-filter-select,.profile-filter-input) { min-height: 44px; max-width: 100%; }
#team-profile.profile-refresh :is(.profile-filter-button,.profile-tab-retry) { min-height: 44px; }
#team-profile.profile-refresh :is(#team-leaders-toggle,#forAgainstToggle) { position: relative; appearance: none; flex: 0 0 50px; width: 50px !important; height: 44px !important; min-height: 44px; border: 0 !important; border-radius: 8px; padding: 0; margin: 0 !important; background: transparent !important; box-shadow: none; cursor: pointer; }
#team-profile.profile-refresh :is(#team-leaders-toggle,#forAgainstToggle)::before { content: ''; display: block !important; position: absolute; inset: 10px 0; width: auto; height: auto; border-radius: 14px; background: #dbe2ea; opacity: 1; }
#team-profile.profile-refresh :is(#team-leaders-toggle,#forAgainstToggle).active::before { background: var(--team-primary, #173758); }
#team-profile.profile-refresh :is(#team-leaders-toggle,#forAgainstToggle) .toggle-slider { position: absolute; top: 12px !important; left: 2px !important; width: 20px !important; height: 20px !important; border-radius: 50%; background: #fff; transform: none !important; box-shadow: 0 1px 3px #192b4326; }
#team-profile.profile-refresh :is(#team-leaders-toggle,#forAgainstToggle).active .toggle-slider { left: 28px !important; }
#team-profile.profile-refresh .toggle-container .toggle-label { font-size: .8rem; font-weight: 500; color: var(--profile-muted); }
#team-profile.profile-refresh .stat-guide-hover-btn { min-height: 44px !important; }

@media (max-width: 820px) {
    #team-profile.profile-refresh [data-testid="hero-banner"] { min-height: 0 !important; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .share-btn { left: 10px !important; right: auto !important; top: 10px !important; width: 44px !important; height: 44px !important; }
    #team-profile.profile-refresh [data-testid="hero-banner"] [data-testid="bookmark-btn"] { left: 54px !important; right: auto !important; top: 10px !important; width: 44px !important; height: 44px !important; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .hero-content { min-height: 0 !important; padding: 0 16px !important; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .team-header { grid-template-columns: 84px minmax(0, 1fr); gap: 16px !important; min-height: 0 !important; padding: 64px 0 18px; }
    #team-profile.profile-refresh .team-logo-container { left: 16px; bottom: 46px; width: 84px; height: 152px; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .team-title-row { gap: 9px !important; padding-right: 0; }
    #team-profile.profile-refresh .team-name-row { gap: 8px; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .team-name { font-size: clamp(1.3rem, 3.8vw, 1.75rem) !important; }
    #team-profile.profile-refresh .team-season-badge { font-size: .72rem; padding: 4px 10px; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .team-meta-info { gap: 4px 10px !important; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .team-meta-info .meta-item,
    #team-profile.profile-refresh [data-testid="hero-banner"] .team-meta-info .meta-item :is(span,i) { font-size: .74rem !important; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .quick-stats,
    #team-profile.profile-refresh [data-testid="hero-banner"] .team-identity-percentage { display: none !important; }
    #team-profile.profile-refresh [data-testid="tabs-menu"] { margin: 0 !important; }
    #team-profile.profile-refresh [data-testid="tabs-menu"] .profile-nav { display: grid !important; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 0 !important; overflow: visible !important; }
    #team-profile.profile-refresh [data-testid="tabs-menu"] .profile-nav .nav-tab { width: 100% !important; padding: 12px 2px !important; font-size: .8rem !important; letter-spacing: 0; }
    #team-profile.profile-refresh .profile-tab-desktop { display: none !important; }
    #team-profile.profile-refresh .profile-tab-mobile { display: inline !important; }
    #team-profile.profile-refresh :is(.content-card,.game-log-container) { padding: 18px; }
    #team-profile.profile-refresh #overview .team-leaders-header { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
    #team-profile.profile-refresh #overview .grid-stat { padding: 14px 12px; }
    #team-profile.profile-refresh #overview .grid-stat-value { font-size: 1.35rem; }
    #team-profile.profile-refresh #overview .leader-card { padding: 16px 10px; }
    #team-profile.profile-refresh #overview .leader-name { font-size: .8rem; line-height: 1.4; }
    #team-profile.profile-refresh #overview .leader-stat { font-size: .68rem; line-height: 1.4; }
    #team-profile.profile-refresh #overview .leader-value { font-size: 1.35rem; }
}
@media (max-width: 480px) {
    #team-profile.profile-refresh [data-testid="hero-banner"] .hero-content { padding: 0 12px !important; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .team-header { grid-template-columns: 80px minmax(0,1fr); gap: 12px !important; }
    #team-profile.profile-refresh .team-logo-container { left: 12px; width: 80px; }
    #team-profile.profile-refresh [data-testid="hero-banner"] .team-name { font-size: 1.3rem !important; }
    #team-profile.profile-refresh [data-testid="tabs-menu"] .profile-nav .nav-tab { padding: 12px 2px !important; font-size: .72rem !important; }
    #team-profile.profile-refresh :is(.content-card,.game-log-container) { padding: 16px; }
    #team-profile.profile-refresh #overview .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    #team-profile.profile-refresh .team-overview-copy { font-size: .9rem; }
    #team-profile.profile-refresh .card-header > span { font-size: 1rem !important; }
}
@media (prefers-reduced-motion: reduce) {
    #team-profile.profile-refresh *, #team-profile.profile-refresh *::before, #team-profile.profile-refresh *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
