<mat-card class="my-3">
    <mat-card-header class="bg-{{color}}-light text-bg-primary d-flex rounded-top py-2 px-3">
        <div class="flex-fill">
            <mat-card-title>
                {{ title }}
            </mat-card-title>
        </div>
        <span class="flex-spacer"></span>
        <div class="align-self-center text-end">
            <span class="fs-5 font-light">{{ subtitle }}</span>
        </div>
    </mat-card-header>
    <mat-card-content class="p-0">
        <table class="table table-striped table-condensed border-top border-light">
            <thead>
                <tr role="row" class="bg-{{color}}-light text-bg-primary bg-opacity-50">
                    <th class="align-middle w-auto ps-4">
                        <div class="text-start">
                            #
                        </div>
                    </th>
                    <th class="align-middle w-auto">
                        <div class="text-start">
                            Name
                        </div>
                    </th>
                    <th class="align-middle w-auto pe-4">
                        <div class="d-flex align-items-center justify-content-end">
                            Power
                            <mat-icon fontIcon="arrow_downward" class="ms-1 icon-xsmall"></mat-icon>
                        </div>
                    </th>
                </tr>
            </thead>
            <tbody>
                @for (champion of getChampionsByPower(); track champion; let index = $index) {
                    <tr role="row" class="align-middle">
                        <td class="cell text-start ps-4">
                            {{ (index+1) }}
                        </td>
                        <td class="cell text-start">
                            {{ champion.name }}
                        </td>
                        <td class="cell font-monospace text-end pe-4">
                            @if (teamType === 'heroes') {
                                {{ champion.heroes.power | number : '1.0' }}
                            }
                            @else {
                                {{ champion.titans.power | number : '1.0' }}
                            }
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </mat-card-content>
</mat-card>