/* ==============================================
   TEAM DETAIL PAGE
   Matches GoalLogic's existing dark/light theme
   using the same CSS variables as navbar.css
=============================================== */


/* Dark mode override for shared stat_card_header */
.dark-mode .stat_card_header {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

.dark-mode .stats-breadcrumb .crumb,
.dark-mode .stats-breadcrumb .ball-icon,
.dark-mode .stats-breadcrumb .league-title {
    color: var(--text-secondary);
}

.dark-mode .stats-breadcrumb .sep {
    color: var(--text-tertiary);
}

/* ==============================================
   PAGE WRAPPER
=============================================== */

.team-detail-page {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ==============================================
   BREADCRUMB
=============================================== */

.team-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 14px 20px 0;
    flex-wrap: wrap;
}

.team-breadcrumb a {
    color: var(--text-tertiary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.team-breadcrumb a:hover {
    color: var(--accent-green);
}

.team-breadcrumb .sep {
    color: var(--text-tertiary);
    font-size: 10px;
}

.team-breadcrumb .current {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ==============================================
   TEAM HEADER CARD
=============================================== */

.team-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.team-header-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--bg-secondary);
    padding: 6px;
}

.team-header-logo-placeholder {
    width: 72px;
    height: 72px;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 28px;
    flex-shrink: 0;
}

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

.team-header-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px;
    line-height: 1.2;
}

.team-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

.team-header-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-header-meta-item img.flag {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
}

.team-header-meta-item i {
    font-size: 12px;
    color: var(--text-tertiary);
}

.team-header-meta-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.team-header-meta-item a:hover {
    color: var(--accent-green);
}

/* Standing badge */
.team-standing-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==============================================
   FORM BADGES (W / D / L)
   — uses the same styles as stats.css
=============================================== */

.team-form-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px 0;
}

.team-form-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 4px;
}

/* ==============================================
   TAB NAVIGATION
=============================================== */

.team-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin: 14px 0 0;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.team-tab {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.18s, border-color 0.18s;
    cursor: pointer;
}

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

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

/* ==============================================
   TAB CONTENT PANELS
=============================================== */

.team-tab-panel {
    display: none;
    padding: 16px 20px 20px;
}

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


/* ── Overall Form — scoped to team page only ── */
.team-overall-form-block {
    width: 100%;
}

.team-overall-form-block .standings-title-block {
    text-align: center;
}

.team-overall-form-block .standings-title {
    text-align: center;
}

.team-overall-form-block .perf-comparison-row {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

.team-overall-form-block .perf-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ── Uniform spacing between summary blocks ── */
.team-tab-panel .ss-wrap {
    margin-top: 20px;
    margin-bottom: 20px;
}

.team-tab-panel .team-section-title {
    margin-top: 20px;
}

/* ==============================================
   SECTION TITLE
=============================================== */

.team-section-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

/* ==============================================
   SUMMARY TAB — NEXT FIXTURE CARD
=============================================== */

.team-next-fixture {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: border-color 0.18s;
}

.team-next-fixture:hover {
    border-color: var(--accent-green);
}

.team-next-fixture-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-green);
    margin-bottom: 6px;
}

.team-next-fixture-teams {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.team-next-fixture-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 60px;
}

.team-next-fixture-team img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.team-next-fixture-team span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-next-fixture-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.team-next-fixture-vs .vs-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-tertiary);
}

.team-next-fixture-vs .vs-date {
    font-size: 11px;
    color: var(--text-tertiary);
}

.team-next-fixture-vs .vs-time {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.team-next-fixture-league {
    font-size: 11px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.team-next-fixture-league img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.team-next-fixture-league-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.team-next-fixture-league-center img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* ==============================================
   SUMMARY STATS GRID
=============================================== */

.team-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.team-stat-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
}

.team-stat-box .stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.team-stat-box .stat-value.green {
    color: #22c55e;
}

.team-stat-box .stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}


/* ── Season Stats Widget ── */
.ss-wrap { padding: 0 0 8px; }
.ss-tabs { display:flex; gap:0; border-bottom:1px solid var(--border-color); margin-bottom:16px; overflow-x:auto; scrollbar-width:none; }
.ss-tabs::-webkit-scrollbar { display:none; }
.ss-tab { padding:8px 14px; font-size:12px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-tertiary); border:none; background:none; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap; transition:color .15s,border-color .15s; }
.ss-tab.active { color:var(--accent-green); border-bottom-color:var(--accent-green); }
.ss-panel { display:none; } .ss-panel.active { display:block; }
.ss-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:14px; }
.ss-card { background:var(--bg-secondary); border-radius:8px; padding:12px 10px; text-align:center; }
.ss-card-val { font-size:20px; font-weight:800; color:var(--text-primary); line-height:1; margin-bottom:3px; }
.ss-card-val.green { color:#22c55e; }
.ss-card-lbl { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-tertiary); }
.ss-bar-section { display:flex; flex-direction:column; gap:8px; }
.ss-bar-row { display:grid; grid-template-columns:90px 1fr 50px; align-items:center; gap:8px; }
.ss-bar-lbl { font-size:12px; color:var(--text-secondary); text-align:right; }
.ss-bar-track { background:var(--border-color); border-radius:3px; height:6px; overflow:hidden; }
.ss-bar-fill { height:100%; border-radius:3px; width:0; transition:width .6s cubic-bezier(.4,0,.2,1); }
.ss-bar-val { font-size:12px; font-weight:700; color:var(--text-primary); }
.ss-venue-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px; }
.ss-venue-card { background:var(--bg-secondary); border-radius:8px; padding:12px; text-align:center; }
.ss-venue-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-tertiary); margin-bottom:8px; }
.ss-venue-stat { font-size:16px; font-weight:800; color:var(--text-primary); }
.ss-venue-sub { font-size:10px; color:var(--text-tertiary); margin-top:2px; }
.ss-venue-divider { height:1px; background:var(--border-color); margin:8px 0; }
.ss-form-row { display:flex; align-items:center; justify-content:center; gap:5px; margin-bottom:8px; }
.ss-form-label-sm { font-size:11px; color:var(--text-tertiary); text-align:center; margin:10px 0 6px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }

.ss-fbadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 600;
    color: white;
    margin: 0 1px;
    flex-shrink: 0;
}
.ss-fbadge.W { background: #16a34a; }
.ss-fbadge.D { background: #e7c57d; color: #92400e; }
.ss-fbadge.L { background: #c0152a; }

.ss-ou-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:14px; }
.ss-ou-card { background:var(--bg-secondary); border-radius:8px; padding:10px 6px; text-align:center; }
.ss-ou-val { font-size:16px; font-weight:800; margin-bottom:2px; }
.ss-ou-lbl { font-size:10px; color:var(--text-tertiary); font-weight:700; text-transform:uppercase; letter-spacing:.04em; }

/* ==============================================
   RESULTS / FIXTURES TABLE
=============================================== */

.team-matches-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-match-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
    background: transparent;
}

.team-match-row:hover {
    background: var(--bg-secondary);
}

.team-match-date {
    font-size: 11px;
    color: var(--text-tertiary);
    min-width: 72px;
    flex-shrink: 0;
}

.team-match-league-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-match-teams {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

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

.team-match-home,
.team-match-away {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.team-match-home.highlight,
.team-match-away.highlight {
    color: var(--accent-green);
}

.team-match-score {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-radius: 5px;
    padding: 2px 8px;
    flex-shrink: 0;
    min-width: 36px;
    text-align: center;
}

.team-match-score.upcoming {
    background: transparent;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
}

/* Outcome dot */
.team-match-outcome {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
}

.team-match-outcome.W { background: #166534; color: #bbf7d0; }
.team-match-outcome.D { background: #854d0e; color: #fef08a; }
.team-match-outcome.L { background: #991b1b; color: #fecaca; }

/* Home/Away tag */
.team-match-venue-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border-radius: 3px;
    padding: 1px 5px;
    flex-shrink: 0;
}

/* ==============================================
   STANDINGS TABLE
=============================================== */

.team-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.team-standings-table thead tr {
    border-bottom: 1px solid var(--border-color);
}

.team-standings-table th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 6px 8px;
    text-align: center;
}

.team-standings-table th:nth-child(2) {
    text-align: left;
}

.team-standings-table td {
    padding: 8px 8px;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.team-standings-table td:nth-child(2) {
    text-align: left;
}

.team-standings-table tr:last-child td {
    border-bottom: none;
}

.team-standings-table tr.highlighted-team td {
    background: rgba(34, 197, 94, 0.06);
    color: var(--text-primary);
    font-weight: 700;
}

.team-standings-table tr.highlighted-team td:nth-child(2) {
    color: var(--accent-green);
}

.standings-team-cell {
    display: flex;
    align-items: center;
    gap: 7px;
}

.standings-team-cell img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.standings-team-cell a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.standings-team-cell a:hover {
    color: var(--accent-green);
}

.standings-pos {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 20px;
}

.zone-dot {
    width: 4px;
    height: 32px;
    border-radius: 2px;
    flex-shrink: 0;
}

.zone-dot.zone-champions    { background: #1e40af; }
.zone-dot.zone-europa       { background: #0891b2; }
.zone-dot.zone-conference   { background: #059669; }
.zone-dot.zone-playoff      { background: #d97706; }
.zone-dot.zone-relegation   { background: #dc2626; }

/* ==============================================
   SQUAD TABLE
=============================================== */

.team-squad-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-squad-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.15s;
}

.team-squad-row:hover {
    background: var(--bg-secondary);
}

.squad-position-badge {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border-radius: 3px;
    padding: 2px 5px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.squad-player-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.squad-player-age {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==============================================
   EMPTY STATE
=============================================== */

.team-empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.team-empty-state i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
    opacity: 0.4;
}

/* ==============================================
   NOT FOUND
=============================================== */

.team-not-found {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.team-not-found i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.3;
}

.team-not-found h2 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0 0 8px;
}

/* ── Team name + star row ── */
.team-header-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.team-fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-tertiary);
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.team-fav-btn:hover {
    color: var(--accent-yellow);
    transform: scale(1.15);
}

.team-fav-btn.active i {
    font-weight: 900; /* switches to solid star */
}

.team-fav-btn .fa-solid {
    color: var(--accent-yellow);
}

/* Venue block — stacks Stadium and Capacity on separate lines */
.team-header-venue {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

/* ── Two-column results + stats row ── */
.team-results-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
    align-items: start;
}

/* Left card — reuses last6-card styles */
.team-results-stats-row .last6-card {
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    overflow: hidden;
}

/* Right card — Overall Statistics */
.team-overall-stats-card {
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.tos-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border-color);
}

.tos-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.tos-header-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tos-team-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.tos-played-badge {
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 2px 7px;
    width: fit-content;
}

/* Tabs */
.tos-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 0 12px;
}

.tos-tab {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-tertiary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}

.tos-tab.active { color: var(--accent-green, #22c55e); border-bottom-color: var(--accent-green, #22c55e); }

/* Panels */
.tos-panel { display: none; padding: 10px 14px 14px; }
.tos-panel.active { display: block; }

.tos-section-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    padding: 5px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    text-align: center;
}

/* Goals dual bar */
.tos-goals-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tos-goals-num {
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
    min-width: 24px;
    text-align: center;
}

.tos-goals-num.scored { color: #c0152a; }
.tos-goals-num.conceded { color: var(--text-primary); }

.tos-dual-bar-wrap { flex: 1; }

.tos-dual-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border-color);
}

.tos-dual-fill {
    height: 100%;
    width: 0%;
    transition: width .7s cubic-bezier(.4,0,.2,1);
}

.tos-dual-fill.scored { background: #c0152a; }
.tos-dual-fill.conceded { background: #334155; }

.tos-dual-vals {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
}

.tos-dual-pct {
    font-size: 10px;
    font-weight: 700;
}

.tos-dual-pct.scored { color: #c0152a; }
.tos-dual-pct.conceded { color: var(--text-primary); }

/* OU blocks */
.tos-ou-block {
    margin-bottom: 10px;
}

.tos-ou-lbl {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    background: var(--bg-secondary);
    padding: 3px 6px;
    border-radius: 3px;
    margin-bottom: 4px;
}

.tos-ou-row {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    gap: 2px;
}

.tos-ou-bar-wrap {
    flex: 1;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.tos-ou-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width .7s cubic-bezier(.4,0,.2,1);
}

.tos-ou-fill.under { background: #c0152a; }
.tos-ou-fill.over  { background: #334155; }

.tos-ou-pcts {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Phone layout: summary blocks should read as full-width sections. */
@media (max-width: 768px) {
    .team-detail-page .team-tabs {
        gap: 6px;
        padding: 8px 10px;
        border-bottom: 1px solid var(--border-color);
    }

    .team-detail-page .team-tab {
        flex: 1 0 auto;
        min-height: 38px;
        padding: 9px 13px;
        border: 1px solid var(--border-color);
        border-radius: 999px;
        margin: 0;
        background: var(--bg-primary);
        color: #475569;
        text-align: center;
    }

    .team-detail-page .team-tab.active {
        color: #ffffff;
        background: #16865a;
        border-color: #16865a;
        box-shadow: 0 2px 8px rgba(22, 134, 90, 0.24);
    }

    .team-detail-page .team-tab-panel {
        padding: 14px 10px 20px;
    }

    .team-detail-page .team-results-stats-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .team-detail-page .team-results-stats-row .last6-card,
    .team-detail-page .team-overall-stats-card {
        width: 100%;
        min-width: 0;
        border-radius: 10px;
    }

    .team-detail-page .tos-tabs {
        gap: 4px;
        padding: 7px 8px 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .team-detail-page .tos-tabs::-webkit-scrollbar {
        display: none;
    }

    .team-detail-page .tos-tab {
        flex: 1 0 auto;
        min-height: 36px;
        padding: 8px 10px;
        border: 1px solid transparent;
        border-radius: 7px 7px 0 0;
        color: #475569;
        font-size: 10px;
    }

    .team-detail-page .tos-tab.active {
        color: #047857;
        background: #ecfdf5;
        border-color: #a7f3d0;
        border-bottom-color: #10b981;
    }

    .team-detail-page .tos-panel {
        padding: 14px 12px 16px;
    }
}

.dark-mode .team-detail-page .team-tab {
    color: #cbd5e1;
    background: #172033;
    border-color: #3a4960;
}

.dark-mode .team-detail-page .team-tab.active {
    color: #ffffff;
    background: #16865a;
    border-color: #35c987;
}

.dark-mode .team-detail-page .tos-tab {
    color: #cbd5e1;
}

.dark-mode .team-detail-page .tos-tab.active {
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(52, 211, 153, 0.42);
    border-bottom-color: #34d399;
}

/* ==============================================
   UPCOMING FIXTURES — grouped by competition
=============================================== */

.upcoming-fixtures-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

/* League group */
.uf-league-group {
    display: flex;
    flex-direction: column;
}

.uf-league-group + .uf-league-group {
    border-top: 2px solid var(--border-color);
}

/* League header */
.uf-league-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.uf-league-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.uf-league-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    transition: color 0.15s;
}

a.uf-league-name:hover {
    color: var(--accent-green, #22c55e);
    text-decoration: underline;
}

/* Individual fixture row */
.uf-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
    background: var(--bg-primary, white);
}

.uf-row:last-child {
    border-bottom: none;
}

.uf-row:hover {
    background: var(--bg-secondary);
}

/* Date column */
.uf-date-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 70px;
    flex-shrink: 0;
}

.uf-date {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.3;
}

.uf-time {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Teams column */
.uf-teams-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.uf-team {
    display: flex;
    align-items: center;
    gap: 7px;
}

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

.uf-team-logo-placeholder {
    width: 18px;
    height: 18px;
    background: var(--bg-secondary);
    border-radius: 3px;
    flex-shrink: 0;
}

.uf-team-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlight the current team */
.uf-team--active .uf-team-name {
    font-weight: 700;
    color: var(--text-primary);
}

/* Venue badge column */
.uf-venue-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 26px;
}

.uf-venue-badge {
    font-size: 10px;
    font-weight: 800;
    border-radius: 4px;
    padding: 2px 6px;
    letter-spacing: 0.04em;
}

.uf-venue-home {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.uf-venue-away {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
}

/* Dark mode tweaks */
.dark-mode .uf-row {
    background: var(--bg-primary);
}

.dark-mode .uf-row:hover {
    background: var(--bg-secondary);
}

.dark-mode .uf-venue-home {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

/* ==============================================
   LAST 10 RESULTS — grouped by competition
=============================================== */

/* Filter bar */
.tr-filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 14px 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tr-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.tr-filter-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.tr-filter-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary, white);
    border-color: var(--text-primary);
}

.tr-filter-logo {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* Results list */
.tr-results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

/* League group */
.tr-league-group {
    display: flex;
    flex-direction: column;
}

.tr-league-group + .tr-league-group {
    border-top: 2px solid var(--border-color);
}

.tr-league-group.tr-hidden {
    display: none;
}

/* League header */
.tr-league-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tr-league-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.tr-league-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    transition: color 0.15s;
}

a.tr-league-name:hover {
    color: var(--accent-green, #22c55e);
    text-decoration: underline;
}

/* Individual result row */
.tr-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
    background: var(--bg-primary, white);
}

.tr-row:last-child {
    border-bottom: none;
}

.tr-row:hover {
    background: var(--bg-secondary);
}

/* Date column */
.tr-date-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 70px;
    flex-shrink: 0;
}

.tr-date {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.3;
}

.tr-status {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Teams column */
.tr-teams-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.tr-team {
    display: flex;
    align-items: center;
    gap: 7px;
}

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

.tr-team-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlight the current team */
.tr-team--active .tr-team-name {
    font-weight: 700;
    color: var(--text-primary);
}

/* Score */
.tr-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 16px;
    text-align: right;
    flex-shrink: 0;
}

/* Outcome badge column */
.tr-outcome-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 28px;
}



.tr-outcome-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
}

.tr-outcome-W { background: #166534; color: #bbf7d0; }
.tr-outcome-D { background: #854d0e; color: #fef08a; }
.tr-outcome-L { background: #991b1b; color: #fecaca; }
.tr-outcome-U { background: var(--bg-secondary); color: var(--text-tertiary); }

/* Dark mode */
.dark-mode .tr-row { background: var(--bg-primary); }
.dark-mode .tr-row:hover { background: var(--bg-secondary); }
.dark-mode .tr-filter-btn.active {
    background: var(--text-primary);
    color: var(--text-primary);
}

/* Penalty shootout score */
.tr-pen {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    margin-left: 2px;
}

/* FIND: */
.tr-status {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* REPLACE WITH: */
.tr-status {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: default;
}
