/* Home rankings panels — aligned with monthly awards / HOF tops */
.hr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 1240px;
    width: 100%;
    margin: 32px auto 24px;
    padding: 0;
    box-sizing: border-box;
}

.hr-panel {
    --hr-accent: var(--accent-color, #7C4DFF);
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--hr-accent) 20%, var(--border-color));
    background:
        radial-gradient(ellipse 90% 70% at 0% 0%, color-mix(in srgb, var(--hr-accent) 10%, transparent), transparent 55%),
        var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.hr-panel--teams {
    --hr-accent: #7c4dff;
}

.hr-panel--players {
    --hr-accent: #e89a3c;
}

.hr-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.hr-panel__eyebrow {
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hr-accent);
}

.hr-panel__eyebrow img {
    width: 1em;
    height: 1em;
    object-fit: contain;
}

.hr-panel__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-color);
}

.hr-panel__link {
    flex-shrink: 0;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
    opacity: 0.7;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.hr-panel__link:hover {
    color: var(--hr-accent);
    opacity: 1;
}

.hr-panel__link img {
    width: 1em;
    height: 1em;
    object-fit: contain;
}

.hr-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.hr-switcher__btn {
    appearance: none;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--text-color) 3%, var(--card-bg));
    color: var(--text-color);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hr-switcher__btn:hover {
    border-color: color-mix(in srgb, var(--hr-accent) 45%, var(--border-color));
    color: var(--hr-accent);
}

.hr-switcher__btn.active {
    background: var(--hr-accent);
    border-color: var(--hr-accent);
    color: #fff;
}

.hr-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.hr-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 8px;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.hr-panel--players .hr-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
}

.hr-row:hover {
    background: color-mix(in srgb, var(--hr-accent) 8%, transparent);
}

.hr-row__rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-color);
    opacity: 0.55;
    background: color-mix(in srgb, var(--text-color) 6%, transparent);
}

.hr-row:nth-child(1) .hr-row__rank {
    opacity: 1;
    color: #4a2f0b;
    background: linear-gradient(135deg, #f6d365, #fda085);
}

.hr-row:nth-child(2) .hr-row__rank {
    opacity: 1;
    color: #333;
    background: linear-gradient(135deg, #d7d7d7, #9aa5b1);
}

.hr-row:nth-child(3) .hr-row__rank {
    opacity: 1;
    color: #fff;
    background: linear-gradient(135deg, #cd7f32, #a0522d);
}

.hr-row__entity {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.hr-row__logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.hr-row__flag {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.hr-row__role {
    width: 14px;
    height: 14px;
    object-fit: contain;
    flex-shrink: 0;
}

.hr-row__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    transition: color 0.15s ease;
}

.hr-row__entity:hover .hr-row__name,
.hr-row__name-link:hover .hr-row__name {
    color: var(--hr-accent);
}

.hr-row__name-link {
    display: inline-flex;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.hr-row__team-logo {
    display: inline-flex;
    flex-shrink: 0;
}

.hr-row__metric {
    font-size: 0.95rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--hr-accent);
    text-align: right;
    min-width: 3.2ch;
}

.hr-row__change {
    min-width: 3.2ch;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.hr-change {
    display: inline-block;
}

.hr-change--up {
    color: #2e7d32;
}

.hr-change--down {
    color: #c62828;
}

.hr-change--flat,
.hr-change--new {
    color: var(--text-color);
    opacity: 0.5;
}

.hr-change--new {
    opacity: 0.75;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

@media (max-width: 900px) {
    .hr-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 24px;
    }
}

@media (max-width: 480px) {
    .hr-panel {
        padding: 14px;
    }

    .hr-panel__title {
        font-size: 1.05rem;
    }

    .hr-row {
        grid-template-columns: 24px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 7px 4px;
    }

    .hr-panel--teams .hr-row {
        grid-template-columns: 24px minmax(0, 1fr) auto auto;
    }

    .hr-row__rank {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}
