.teams-page {
    --team-yellow: #f2c230;
    --team-black: #17191b;
    --team-muted: #6f7679;
    --team-border: rgba(17, 19, 21, .12);
}

.teams-page main { overflow: visible; }

.teams-intro {
    border-bottom: 1px solid var(--team-border);
    background: linear-gradient(118deg, #e3ad16 0%, #f2c230 48%, #f6d569 100%);
}

.teams-intro-inner,
.teams-toolbar-shell,
.teams-main-shell {
    width: min(var(--max-width), calc(100% - 56px));
    margin: 0 auto;
}

.teams-intro-inner {
    min-height: 235px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 42px;
    padding: 50px 0 42px;
}

.teams-intro h1 {
    margin: 0;
    color: #111315;
    font-size: clamp(3rem, 6vw, 5.2rem);
    line-height: .94;
    letter-spacing: -.06em;
}

.teams-intro-copy {
    max-width: 800px;
    margin: 16px 0 0;
    color: rgba(17, 19, 21, .78);
    line-height: 1.6;
}

.teams-freshness {
    flex: 0 0 auto;
    max-width: 410px;
    padding: 12px 15px;
    color: #111315;
    background: rgba(255, 255, 255, .44);
    border: 1px solid rgba(17, 19, 21, .16);
    border-radius: 10px;
    font-size: .76rem;
    font-weight: 750;
    line-height: 1.45;
    text-align: right;
}

.teams-toolbar-shell {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    padding: 28px 0 20px;
}

.team-selection-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.team-picker-wrap,
.scope-detail label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #70777a;
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.team-select,
.compact-select {
    border: 1px solid var(--team-border);
    border-radius: 9px;
    background: #fff;
    color: #17191b;
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
}

.team-select { min-width: 260px; padding: 11px 34px 11px 12px; }
.season-select { min-width: 112px; }
.compact-select { min-width: 82px; padding: 8px 28px 8px 9px; }

.scope-controls,
.scope-detail {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.scope-tabs,
.room-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #f0f1ee;
    border: 1px solid rgba(17, 19, 21, .08);
    border-radius: 10px;
}

.scope-tab,
.room-tab,
.apply-button {
    appearance: none;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #596064;
    padding: 8px 12px;
    font: inherit;
    font-size: .72rem;
    font-weight: 850;
    cursor: pointer;
}

.scope-tab.is-active,
.room-tab.is-active,
.apply-button {
    background: var(--team-black);
    color: var(--team-yellow);
}

.scope-static-note {
    color: #777e81;
    font-size: .7rem;
    line-height: 1.4;
}

.teams-main-shell {
    margin-bottom: 64px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--team-border);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(17, 19, 21, .07);
}

.team-title-row,
.room-heading-row,
.subsection-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
}

.team-title-row h2 {
    margin: 3px 0 5px;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    letter-spacing: -.04em;
}

.team-title-row p,
.room-heading-row p,
.subsection-heading p {
    margin: 0;
    color: var(--team-muted);
    font-size: .76rem;
    line-height: 1.5;
}

.view-kicker {
    margin: 0;
    color: #8a6900;
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .1em;
}

.team-matchup {
    color: #70777a;
    font-size: .72rem;
    font-weight: 800;
    text-align: right;
}

.team-pulse-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.team-pulse-card,
.loading-card {
    min-height: 88px;
    padding: 15px;
    border: 1px solid rgba(17, 19, 21, .09);
    border-radius: 10px;
    background: #f7f7f3;
}

.team-pulse-card small,
.team-pulse-card strong { display: block; }
.team-pulse-card small {
    color: #7b8285;
    font-size: .59rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.team-pulse-card strong {
    margin-top: 10px;
    color: #17191b;
    font-size: 1.35rem;
    line-height: 1;
}

.context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.context-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--team-border);
    border-radius: 11px;
    background: #fff;
}

.context-card h3,
.room-heading-row h3,
.subsection-heading h4 {
    margin: 4px 0 8px;
    color: #17191b;
}
.context-card h3 { font-size: 1rem; }
.room-heading-row h3 { font-size: 1.15rem; }
.subsection-heading h4 { font-size: .92rem; }

.state-chips,
.coach-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.state-chips span,
.coach-meta span {
    padding: 8px 10px;
    border-radius: 8px;
    background: #f5f5f1;
}
.state-chips small,
.state-chips strong { display: block; }
.state-chips small {
    color: #858c8f;
    font-size: .55rem;
    font-weight: 900;
}
.state-chips strong { margin-top: 2px; font-size: .72rem; }

.context-note,
.loading-copy {
    margin: 10px 0 0;
    color: #71787b;
    font-size: .7rem;
    line-height: 1.5;
}

.context-metrics { margin-top: 12px; }
.context-metric-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid rgba(17, 19, 21, .07);
    font-size: .68rem;
}
.context-metric-row span { color: #596064; }
.context-metric-row strong { color: #303538; font-variant-numeric: tabular-nums; }
.context-metric-row em { color: #8a6900; font-style: normal; font-weight: 900; font-variant-numeric: tabular-nums; }

.coach-name {
    color: #17191b;
    font-size: .95rem;
    font-weight: 900;
}
.coach-meta { margin-top: 7px; }
.coach-meta span { color: #666d70; font-size: .63rem; font-weight: 750; }

.room-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(17, 19, 21, .1);
}

.subsection-heading { margin-top: 22px; margin-bottom: 10px; }
.current-table-heading { margin-top: 24px; }

.data-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--team-border);
    border-radius: 11px;
    background: #fff;
}

.team-table {
    width: 100%;
    min-width: 960px;
    border-collapse: separate;
    border-spacing: 0;
    color: #17191b;
    font-size: .72rem;
}

.team-table th {
    padding: 11px 12px;
    background: #17191b;
    color: #f4f5f3;
    border-bottom: 2px solid #f2c230;
    text-align: left;
    font-size: .59rem;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.team-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(17, 19, 21, .075);
    background: #fff;
    vertical-align: middle;
}
.team-table tbody tr:nth-child(even) td { background: #fffdf7; }
.team-table tbody tr:hover td { background: #fff7dd; }
.team-table tbody tr:last-child td { border-bottom: 0; }
.team-table th:first-child,
.team-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 7px 0 12px -12px rgba(17, 19, 21, .55);
}
.team-table th:first-child { z-index: 5; background: #17191b; }
.team-table tbody tr:nth-child(even) td:first-child { background: #fffdf7; }
.team-table tbody tr:hover td:first-child { background: #fff7dd; }

.team-table td > small,
.stacked small {
    display: block;
    margin-top: 2px;
    color: #7a8184;
    font-size: .62rem;
    line-height: 1.35;
}
.stacked strong { display: block; white-space: nowrap; }
.player-link { color: #17191b; text-decoration: none; }
.player-link:hover { text-decoration: underline; text-decoration-color: #d6a900; }
.role-cell { min-width: 190px; color: #565d60; font-size: .66rem; }

.category-table { min-width: 1040px; }
.category-cell { min-width: 98px; }
.category-cell > div { display: flex; align-items: baseline; gap: 6px; }
.category-cell small { color: #777e81; font-size: .62rem; font-weight: 750; }
.score-bar {
    display: block;
    width: 72px;
    height: 4px;
    margin-top: 6px;
    border-radius: 999px;
    background: #e7e7e2;
    overflow: hidden;
}
.score-bar i { display: block; height: 100%; border-radius: inherit; background: #d6a900; }
.muted { color: #9ba0a2; }

.empty-state,
.teams-load-error {
    padding: 15px 16px;
    color: #6e7578;
    background: #f7f7f4;
    font-size: .74rem;
    line-height: 1.5;
}
.teams-load-error {
    margin-top: 18px;
    color: #813f2e;
    background: #fbefeb;
    border: 1px solid #e5c8bf;
    border-radius: 9px;
}

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

@media (max-width: 760px) {
    .teams-intro-inner,
    .teams-toolbar-shell,
    .teams-main-shell { width: min(100% - 28px, var(--max-width)); }
    .teams-intro-inner,
    .teams-toolbar-shell,
    .team-title-row,
    .room-heading-row { flex-direction: column; align-items: stretch; }
    .teams-freshness,
    .team-matchup { text-align: left; }
    .team-selection-controls { width: 100%; }
    .team-picker-wrap { flex: 1 1 180px; }
    .season-picker-wrap { flex: 0 1 120px; }
    .team-select { width: 100%; min-width: 0; }
    .scope-controls { align-items: stretch; }
    .team-pulse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teams-main-shell { padding: 18px; }
    .context-metric-row { grid-template-columns: 1fr; gap: 3px; }
    .room-tabs { width: max-content; max-width: 100%; overflow-x: auto; }
}
