.teams-page {
    width: min(1360px, 100%);
    min-height: 80vh;
    margin: 0 auto;
    padding: 24px;
    color: var(--text-slate-900);
    background: var(--bg-slate-100-a60);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .05);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

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

.teams-heading {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 24px;
    padding: 0 2px;
}

.teams-heading h1 {
    color: var(--text-slate-900);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.2;
}

.teams-heading h1 > span[aria-hidden] {
    margin: 0 3px;
    color: var(--site-accent);
}

.teams-heading p {
    color: var(--text-slate-500);
    font-size: 13px;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.team-element {
    min-width: 0;
    overflow: hidden;
    background: var(--bg-white);
    border: 1px solid var(--line-xeef2f7);
    border-radius: 18px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
}

.team-element__header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 12px 18px;
    background: linear-gradient(100deg, color-mix(in srgb, var(--team-accent) 10%, white), rgba(255, 255, 255, .8) 62%);
    border-bottom: 1px solid color-mix(in srgb, var(--team-accent) 12%, #eef2f7);
}

.team-element__icon {
    display: inline-grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    background: var(--team-accent);
    border-radius: 50%;
    box-shadow: 0 3px 8px color-mix(in srgb, var(--team-accent) 24%, transparent);
}

.team-element__icon img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.team-element__header h2 {
    color: var(--text-slate-800);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
}

.team-element__count {
    margin-left: auto;
    color: var(--text-slate-400);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.team-element__roles {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

.team-role {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
}

.team-role__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    color: color-mix(in srgb, var(--team-accent) 75%, #334155);
    background: color-mix(in srgb, var(--team-accent) 8%, white);
    border: 1px solid color-mix(in srgb, var(--team-accent) 12%, white);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.team-role__label span {
    color: var(--text-slate-400);
    font-size: 10px;
    font-weight: 700;
}

.team-role__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    min-width: 0;
}

.team-role__cards .character-card { width: 100%; }

@media (max-width: 1180px) {
    .teams-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .teams-page { padding: 18px 12px; border-radius: 16px; }
    .teams-heading { margin-bottom: 18px; }
    .teams-grid { gap: 14px; }
    .team-element__roles { padding: 12px; }
}

@media (max-width: 600px) {
    .teams-heading { flex-direction: column; gap: 4px; padding: 0 4px; }
    .teams-heading h1 { font-size: 24px; }
    .team-role { grid-template-columns: 1fr; gap: 8px; }
    .team-role__label {
        flex-direction: row;
        align-self: start;
        gap: 6px;
        padding: 5px 10px;
        border-radius: 999px;
    }
    .team-role__cards { grid-template-columns: 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .team-role__cards .character-card { transition: none; }
}
