.teams-page {
    color-scheme: light;
    --teams-surface: #fff;
    --teams-ink: #16231c;
    --teams-muted: #637068;
    --teams-line: #dce5df;
    --teams-accent: #17633d;
    --teams-accent-soft: #e3f1e9;
    --teams-shadow: 0 18px 50px rgba(28, 49, 37, 0.08);
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 64px 0 80px;
    color: var(--teams-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

.teams-page,
.teams-page * {
    box-sizing: border-box;
}

.teams-page h1,
.teams-page h2,
.teams-page h3,
.teams-page p,
.teams-page dl {
    margin-top: 0;
}

.teams-eyebrow {
    margin-bottom: 8px;
    color: var(--teams-accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.teams-heading-row {
    display: flex;
    gap: 24px;
    align-items: end;
    justify-content: space-between;
}

.teams-heading-row h1,
.team-detail-heading h1 {
    margin-bottom: 0;
    font-size: clamp(2.5rem, 6vw, 4.8rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.teams-heading-row > p {
    flex: 0 0 auto;
    margin-bottom: 0;
    color: var(--teams-muted);
    font-weight: 750;
}

.teams-group {
    margin-top: 54px;
}

.teams-group > h2,
.team-section-heading h2,
.team-league-panel h2 {
    margin-bottom: 20px;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    letter-spacing: -0.025em;
}

.team-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.team-card {
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--teams-line);
    border-radius: 24px;
    background: var(--teams-surface);
    box-shadow: 0 12px 36px rgba(28, 49, 37, 0.055);
}

.team-card-photo,
.team-detail-photo,
.team-player-photo {
    display: block;
    width: 100%;
    object-fit: cover;
}
.team-player-photo {
    object-position: center 5%;
}

.team-card-photo {
    aspect-ratio: 16 / 10;
}

.team-photo-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #dfe8e2, #eef3f0);
    color: #718078;
}

.team-photo-placeholder span {
    font-size: 0.82rem;
    font-weight: 850;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.team-card-body {
    display: flex;
    min-height: 270px;
    flex-direction: column;
    padding: 24px;
}

.team-card h3 {
    margin-bottom: 4px;
    font-size: 1.55rem;
    letter-spacing: -0.025em;
}

.team-league {
    margin-bottom: 20px;
    color: var(--teams-accent);
    font-weight: 750;
}

.team-card-facts {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.team-card-facts div {
    display: grid;
    gap: 1px;
}

.team-card-facts dt {
    color: var(--teams-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.team-card-facts dd {
    margin: 0;
    font-weight: 700;
}

.team-card-link,
.teams-back-link,
.team-league-panel a {
    color: var(--teams-accent);
    font-weight: 800;
    text-underline-offset: 0.2em;
}

.team-card-link {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.teams-back-link {
    display: inline-flex;
    margin-bottom: 22px;
}

.team-detail-header {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    overflow: hidden;
    align-items: stretch;
    border: 1px solid var(--teams-line);
    border-radius: 28px;
    background: var(--teams-surface);
    box-shadow: var(--teams-shadow);
}

.team-detail-photo {
    min-height: 360px;
    aspect-ratio: 4 / 3;
}

.team-detail-heading {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 6vw, 64px);
}

.team-season-line {
    margin: 24px 0 0;
    color: var(--teams-muted);
    font-size: 1.05rem;
    font-weight: 700;
}

.team-roster {
    margin-top: 56px;
}

.team-section-heading {
    display: flex;
    gap: 24px;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 20px;
}

.team-section-heading h2,
.team-section-heading p {
    margin-bottom: 0;
}

.team-section-heading > p {
    color: var(--teams-muted);
    font-weight: 750;
}

.team-player-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.team-player-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--teams-line);
    border-radius: 18px;
    background: var(--teams-surface);
    color: inherit;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.team-player-card:hover,
.team-player-card:focus-visible {
    border-color: #b7cbbf;
    box-shadow: var(--teams-shadow);
}

.team-player-card:focus-visible {
    outline: 3px solid rgba(23, 99, 61, 0.22);
    outline-offset: 3px;
}

.team-player-photo {
    width: 72px;
    aspect-ratio: 1;
    border-radius: 50%;
}

.team-player-initials {
    display: grid;
    place-items: center;
    background: var(--teams-accent-soft);
    color: var(--teams-accent);
    font-weight: 850;
    letter-spacing: 0.08em;
}

.team-player-content {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.team-player-content strong {
    overflow-wrap: anywhere;
}

.team-captain-badge {
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--teams-accent-soft);
    color: var(--teams-accent);
    font-size: 0.7rem;
    font-weight: 800;
}

.team-player-arrow {
    color: var(--teams-accent);
}

.team-league-panel {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
    margin-top: 32px;
    padding: 30px;
    border: 1px solid var(--teams-line);
    border-radius: 22px;
    background: var(--teams-surface);
}

.team-league-panel h2,
.team-league-panel p {
    margin-bottom: 0;
}

.teams-state-panel {
    max-width: 720px;
    margin: 10vh auto 0;
    padding: clamp(32px, 7vw, 64px);
    border: 1px solid var(--teams-line);
    border-radius: 28px;
    background: var(--teams-surface);
    box-shadow: var(--teams-shadow);
}

.teams-state-panel h1 {
    margin-bottom: 18px;
    font-size: clamp(2rem, 6vw, 3.6rem);
}

.teams-state-panel p:last-child {
    margin-bottom: 0;
    color: var(--teams-muted);
}

@media (max-width: 900px) {
    .team-card-grid,
    .team-player-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .teams-page {
        width: min(100% - 24px, 1180px);
        padding: 28px 0 48px;
    }

    .teams-heading-row,
    .team-section-heading,
    .team-league-panel {
        display: grid;
        gap: 12px;
        align-items: start;
    }

    .team-card-grid,
    .team-player-grid,
    .team-detail-header {
        grid-template-columns: 1fr;
    }

    .teams-group,
    .team-roster {
        margin-top: 40px;
    }

    .team-detail-photo {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    .team-detail-heading {
        padding: 28px;
    }

    .team-player-card {
        grid-template-columns: 58px minmax(0, 1fr) auto;
    }

    .team-player-photo {
        width: 58px;
    }
}

@media (max-width: 420px) {
    .teams-page .teams-heading-row h1,
    .teams-page .team-detail-heading h1 {
        font-size: 1.65rem !important;
        line-height: 1.1;
        max-width: 100%;
        overflow: visible;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
    }
}