/* Estadísticas de MHStats. Usa los tokens del tema (brand, gold, blue) y las
   superficies de Comunidad; en la portada no se carga community.css, por eso
   los tokens se declaran aquí con los mismos valores de respaldo. */
.mh-stats,
.mh-stats-widget {
    --st-surface: var(--mh-c-surface, #1f1813);
    --st-sunken: var(--mh-c-sunken, #15100c);
    --st-border: var(--mh-c-border, #45362b);
    --st-muted: var(--mh-c-muted, #b8a898);
    --st-dim: var(--mh-c-dim, #8d8177);
    --st-text: var(--text, #f4ede4);
    --st-accent: var(--brand, #f28c14);
    --st-hot: var(--brand-hot, #ffb020);
    --st-gold: var(--gold, #ffc94a);
    --st-ok: #6fd58f;
    --st-bad: #ff8570;
}

.mh-stats .visually-hidden,
.mh-stats-widget .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

.mh-stats-muted {
    margin: 0;
    color: var(--st-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.mh-stats h2 {
    margin: 0 0 14px;
    color: var(--st-text);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.mh-stats > section,
.mh-stats > div:not(.mh-addon-context) {
    margin-bottom: 18px;
}

.mh-stats-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid var(--st-border);
    border-radius: 999px;
    color: var(--st-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Buscador en la cabecera */
.mh-stats-search {
    position: relative;
    display: flex;
    gap: 8px;
    width: min(100%, 360px);
}

.mh-stats-search > i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: var(--st-dim);
    transform: translateY(-50%);
}

.mh-stats-search input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--st-border);
    border-radius: 10px;
    color: var(--st-text);
    background: var(--st-sunken);
}

.mh-stats-search input:focus {
    border-color: var(--st-accent);
    outline: 2px solid color-mix(in srgb, var(--st-accent) 35%, transparent);
    outline-offset: 1px;
}

.mh-stats-search .btn {
    height: 44px;
}

.mh-stats-search-results,
.mh-stats-unavailable {
    padding: 16px 18px;
    border: 1px solid var(--st-border);
    border-radius: 14px;
    background: var(--st-surface);
}

.mh-stats-search-results h2 {
    font-size: 0.95rem;
}

.mh-stats-search-results ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mh-stats-search-results a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--st-border);
    border-radius: 999px;
    color: var(--st-text) !important;
    background: var(--st-sunken);
    font-weight: 700;
    text-decoration: none !important;
}

.mh-stats-search-results img {
    border-radius: 6px;
    image-rendering: pixelated;
}

.mh-stats-search-results p {
    margin: 0;
    color: var(--st-muted);
}

.mh-stats-unavailable {
    display: flex;
    align-items: center;
    gap: 16px;
    border-color: color-mix(in srgb, var(--st-bad) 40%, var(--st-border));
}

.mh-stats-unavailable > i {
    color: var(--st-bad);
    font-size: 1.8rem;
}

.mh-stats-unavailable h1,
.mh-stats-unavailable h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.mh-stats-unavailable p {
    margin: 0;
    color: var(--st-muted);
}

/* Cifras grandes */
.mh-stats-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 12px;
}

.mh-stats-kpis > article,
.mh-stats-kpis > div {
    display: grid;
    gap: 4px;
    padding: 16px 18px;
    border: 1px solid var(--st-border);
    border-radius: 14px;
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--st-accent) 14%, transparent), transparent 9rem),
        var(--st-surface);
}

.mh-stats-kpis i {
    color: var(--st-hot);
    font-size: 1.1rem;
}

.mh-stats-kpis strong,
.mh-stats-kpis dd {
    margin: 0;
    color: var(--st-text);
    font-family: var(--font-family-display, inherit);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.mh-stats-kpis strong small {
    color: var(--st-dim);
    font-size: 0.6em;
}

.mh-stats-kpis span,
.mh-stats-kpis dt {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--st-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.mh-stats-kpis.is-profile {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.mh-stats-kpis.is-profile dd {
    font-size: clamp(1.15rem, 2vw, 1.5rem);
}

/* Tablas */
.mh-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.mh-stats-table th,
.mh-stats-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--st-border);
    color: var(--st-text);
    font-weight: 600;
    text-align: left;
    vertical-align: middle;
}

.mh-stats-table thead th {
    color: var(--st-dim);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mh-stats-table .is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mh-stats-table tbody td.is-num {
    font-weight: 800;
}

.mh-stats-table tbody th a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--st-text) !important;
    text-decoration: none !important;
}

.mh-stats-table tbody th a:hover span,
.mh-stats-table tbody th a:focus-visible span {
    color: var(--st-hot);
}

.mh-stats-table img {
    border-radius: 7px;
    image-rendering: pixelated;
}

.mh-stats-table tr.is-top-1 .mh-stats-table tr.is-top-2 .mh-stats-table tr.is-top-3 .mh-stats-table.is-compact th,
.mh-stats-table.is-compact td {
    padding: 7px 6px;
    font-size: 0.84rem;
}

/* Perfil */
.mh-stats-player-hero {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 20px 22px;
    border: 1px solid var(--st-border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 12% 50%, color-mix(in srgb, var(--st-accent) 18%, transparent), transparent 16rem),
        var(--st-surface);
}

.mh-stats-player-body {
    width: 96px;
    height: auto;
    filter: drop-shadow(0 16px 24px rgb(0 0 0 / 40%));
}

.mh-stats-player-intro h1 {
    margin: 6px 0 8px;
    color: var(--st-text);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    word-break: break-word;
}

.mh-stats-player-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 0 0 12px;
    color: var(--st-muted);
    font-size: 0.84rem;
}

.mh-stats-player-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mh-stats-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 12px;
}

.mh-stats-card {
    padding: 16px 18px;
    border: 1px solid var(--st-border);
    border-radius: 14px;
    background: var(--st-surface);
}

.mh-stats-activity {
    display: grid;
    grid-template-columns: repeat(30, minmax(0, 1fr));
    align-items: end;
    gap: 3px;
    height: 110px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.mh-stats-activity li {
    position: relative;
    height: 100%;
    border-radius: 3px;
    background: color-mix(in srgb, var(--st-border) 60%, transparent);
}

.mh-stats-activity li::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--h, 0%);
    min-height: 2px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--st-hot), var(--st-accent));
    content: '';
}

.mh-stats-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
}

.mh-stats-modes-grid header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.mh-stats-modes-grid h3 {
    margin: 0;
    color: var(--st-text);
    font-size: 1.05rem;
    font-weight: 800;
}

.mh-stats-favorites {
    display: grid;
    gap: 6px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.mh-stats-favorites li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid color-mix(in srgb, var(--st-accent) 30%, var(--st-border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--st-accent) 7%, transparent);
}

.mh-stats-favorites i {
    color: var(--st-hot);
}

.mh-stats-favorites span {
    display: grid;
}

.mh-stats-favorites small {
    color: var(--st-dim);
    font-size: 0.7rem;
}

.mh-stats-favorites strong {
    color: var(--st-text);
    font-size: 0.9rem;
}

.mh-stats-values {
    display: grid;
    margin: 0;
}

.mh-stats-values > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--st-border);
    font-size: 0.85rem;
}

.mh-stats-values > div:last-child {
    border-bottom: 0;
}

.mh-stats-values dt {
    color: var(--st-muted);
    font-weight: 600;
}

.mh-stats-values dd {
    margin: 0;
    color: var(--st-text);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Widget de portada */
.mh-stats-widget {
    margin-block: 0;
}

.mh-stats-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mh-stats-widget-list {
    padding: 18px 20px;
    border: 1px solid var(--st-border);
    border-radius: 16px;
    background: var(--st-surface);
}

.mh-stats-widget-list h3 {
    margin: 0 0 10px;
    color: var(--st-text);
    font-size: 1rem;
    font-weight: 800;
}

.mh-stats-widget-list ol {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mh-stats-widget-list li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.mh-stats-widget-list li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    color: var(--st-text) !important;
    font-weight: 700;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mh-stats-widget-list img {
    border-radius: 5px;
    image-rendering: pixelated;
}

.mh-stats-widget-list strong {
    color: var(--st-hot);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 991.98px) {
    .mh-stats-profile-grid,
    .mh-stats-widget-grid {
        grid-template-columns: 1fr;
    }

    .mh-stats-kpis.is-profile {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .mh-stats-kpis,
    .mh-stats-kpis.is-profile {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mh-stats-kpis > article:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .mh-stats-search {
        width: 100%;
    }

    .mh-stats-table th,
    .mh-stats-table td {
        padding: 8px 5px;
    }

    .mh-stats-table img {
        width: 24px;
        height: 24px;
    }

    .mh-stats-player-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .mh-stats-player-body {
        width: 72px;
    }

    .mh-stats-activity {
        height: 80px;
        gap: 2px;
    }
}

/* ---- Podio y rankings ------------------------------------------------ */
.mh-stats-count {
    display: block;
    margin-top: 6px;
    color: var(--st-hot);
    font-size: 0.82rem;
    font-weight: 700;
}

.mh-stats-rank {
    display: inline-grid;
    min-width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 7px;
    color: var(--st-muted);
    background: var(--st-sunken);
    font-size: 0.78rem;
    font-weight: 900;
}

/* Modalidades con su banner real */
.mh-stats-modebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.mh-stats-modebar a {
    position: relative;
    display: flex;
    align-items: flex-end;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    padding: 12px 14px;
    border: 1px solid var(--st-border);
    border-radius: 12px;
    color: var(--st-text) !important;
    background: var(--st-sunken);
    text-decoration: none !important;
    isolation: isolate;
}

.mh-stats-modebar img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.55) brightness(0.45);
    transition: filter 180ms ease, transform 300ms ease;
}

.mh-stats-modebar a::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgb(15 11 8 / 88%), transparent 70%);
    content: '';
}

.mh-stats-modebar span {
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 8px rgb(0 0 0 / 60%);
}

.mh-stats-modebar a:hover img,
.mh-stats-modebar a:focus-visible img {
    filter: saturate(0.85) brightness(0.62);
    transform: scale(1.04);
}

.mh-stats-modebar a[aria-current] {
    border-color: var(--st-accent);
    box-shadow: 0 0 0 1px var(--st-accent), 0 14px 32px -18px var(--st-accent);
}

.mh-stats-modebar a[aria-current] img {
    filter: saturate(1) brightness(0.72);
}

.mh-stats-modebar a:focus-visible {
    outline: 2px solid var(--st-hot);
    outline-offset: 2px;
}

/* Tablero: selector a la izquierda, podio a la derecha */
.mh-stats-board {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--st-border);
    border-radius: 18px;
    background: var(--st-surface);
}

.mh-stats-picker {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 18px 12px 18px 16px;
    border-right: 1px solid var(--st-border);
    background: var(--st-sunken);
}

.mh-stats-picker h3 {
    margin: 0 0 6px 10px;
    color: var(--st-dim);
    font-size: 0.78rem;
    font-weight: 700;
}

.mh-stats-picker ul {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mh-stats-picker a {
    display: block;
    padding: 7px 10px;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
    color: var(--st-muted) !important;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none !important;
}

.mh-stats-picker a:hover,
.mh-stats-picker a:focus-visible {
    color: var(--st-text) !important;
    background: color-mix(in srgb, var(--st-accent) 7%, transparent);
}

.mh-stats-picker a[aria-current] {
    border-left-color: var(--st-accent);
    color: var(--st-text) !important;
    background: color-mix(in srgb, var(--st-accent) 13%, transparent);
    font-weight: 800;
}

.mh-stats-stage {
    min-width: 0;
    padding: 22px 26px 26px;
    background:
        radial-gradient(ellipse 60% 55% at 50% 62%, color-mix(in srgb, var(--st-gold) 12%, transparent), transparent 70%),
        var(--st-surface);
}

.mh-stats-stage-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
}

.mh-stats-stage-head h2 {
    display: grid;
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.mh-stats-stage-head h2 span {
    color: var(--st-hot);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0;
}

.mh-stats-period {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--st-border);
    border-radius: 999px;
    background: var(--st-sunken);
}

.mh-stats-period a {
    padding: 6px 14px;
    border-radius: 999px;
    color: var(--st-muted) !important;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
}

.mh-stats-period a:hover,
.mh-stats-period a:focus-visible {
    color: var(--st-text) !important;
}

.mh-stats-period a[aria-current] {
    color: #2a1408 !important;
    background: linear-gradient(135deg, var(--st-hot), var(--st-accent));
}

.mh-stats-note {
    margin: 8px 0 0;
    color: var(--st-dim);
    font-size: 0.8rem;
}

/* El podio: bloques de oro, hierro y cobre con textura de píxel */
.mh-stats-podium {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
    max-width: 620px;
    margin: 26px auto 0;
    padding: 0;
    list-style: none;
}

.mh-stats-podium-place {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
}

.mh-stats-podium-place.is-place-1 {
    grid-column: 2;
    grid-row: 1;
}

.mh-stats-podium-place.is-place-2 {
    grid-column: 1;
    grid-row: 1;
}

.mh-stats-podium-place.is-place-3 {
    grid-column: 3;
    grid-row: 1;
}

.mh-stats-podium-player {
    display: flex;
    max-width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 10px;
    color: var(--st-text) !important;
    text-align: center;
    text-decoration: none !important;
    animation: mh-stats-podium-rise 700ms cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
}

.is-place-3 .mh-stats-podium-player { animation-delay: 60ms; }
.is-place-2 .mh-stats-podium-player { animation-delay: 160ms; }
.is-place-1 .mh-stats-podium-player { animation-delay: 300ms; }

.mh-stats-podium-player img {
    width: auto;
    height: 150px;
    margin-bottom: 6px;
    filter: drop-shadow(0 14px 12px rgb(0 0 0 / 45%));
    image-rendering: pixelated;
}

.is-place-1 .mh-stats-podium-player img {
    height: 180px;
}

.mh-stats-podium-player strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mh-stats-podium-player span {
    color: var(--st-hot);
    font-size: 0.92rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.mh-stats-podium-player:hover strong,
.mh-stats-podium-player:focus-visible strong {
    color: var(--st-hot);
}

.mh-stats-podium-player:focus-visible {
    outline: 2px solid var(--st-hot);
    outline-offset: 4px;
    border-radius: 8px;
}

.mh-stats-podium-player.is-vacant {
    display: grid;
    width: 64px;
    height: 128px;
    place-items: center;
    border: 2px dashed var(--st-border);
    border-radius: 10px;
    color: var(--st-dim) !important;
    animation: none;
}

.mh-stats-podium-player.is-vacant i {
    font-size: 1.6rem;
    font-style: normal;
    font-weight: 900;
}

/* Pedestales con el lenguaje de la web: superficie cálida, borde fino,
   filo y medalla del color de cada puesto. */
.mh-stats-podium-place {
    --medal: #ffc94a;
    --medal-deep: #e0962a;
    --medal-ink: #2a1408;
}

.mh-stats-podium-place.is-iron {
    --medal: #e2e6ea;
    --medal-deep: #9aa3ad;
    --medal-ink: #1d2126;
}

.mh-stats-podium-place.is-copper {
    --medal: #f0a36a;
    --medal-deep: #b8672f;
    --medal-ink: #2a1408;
}

.mh-stats-podium-figure {
    position: relative;
}

.mh-stats-podium-figure::after {
    position: absolute;
    right: 18%;
    bottom: -4px;
    left: 18%;
    z-index: -1;
    height: 12px;
    border-radius: 50%;
    background: rgb(0 0 0 / 55%);
    content: '';
    filter: blur(5px);
}

.mh-stats-podium-block {
    position: relative;
    display: grid;
    width: 100%;
    height: 92px;
    place-items: start center;
    padding-top: 16px;
    border: 1px solid color-mix(in srgb, var(--medal) 32%, var(--st-border));
    border-bottom: 0;
    border-top: 3px solid var(--medal);
    border-radius: 14px 14px 0 0;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--medal) 16%, transparent), transparent 75%),
        var(--st-sunken);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%);
}

.mh-stats-podium-block b {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: var(--medal-ink);
    background: linear-gradient(145deg, var(--medal), var(--medal-deep));
    box-shadow: 0 6px 16px -6px var(--medal-deep), inset 0 1px 0 rgb(255 255 255 / 45%);
    font-size: 1.05rem;
    font-weight: 900;
}

.is-place-1 .mh-stats-podium-block {
    height: 124px;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%), 0 -18px 50px -24px color-mix(in srgb, var(--medal) 70%, transparent);
}

.is-place-1 .mh-stats-podium-block b {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
}

.is-place-3 .mh-stats-podium-block {
    height: 70px;
}

.mh-stats-podium-player span {
    color: color-mix(in srgb, var(--medal) 75%, var(--st-hot));
}

.mh-stats-podium.is-empty .mh-stats-podium-block {
    opacity: 0.55;
}

.mh-stats-podium.is-empty .mh-stats-podium-block b {
    filter: saturate(0.4);
}

.mh-stats-podium-empty {
    max-width: 440px;
    margin: 18px auto 0;
    text-align: center;
}

.mh-stats-podium-empty strong {
    color: var(--st-text);
    font-size: 1.05rem;
}

.mh-stats-podium-empty p {
    margin: 4px 0 0;
    color: var(--st-muted);
    font-size: 0.88rem;
}

@keyframes mh-stats-podium-rise {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mh-stats-podium-player {
        animation: none;
    }
}

/* Del 4.º al 10.º */
.mh-stats-rest {
    max-width: 620px;
    margin: 22px auto 0;
}

.mh-stats-rest caption {
    padding: 0 0 6px;
    caption-side: top;
    color: var(--st-dim);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: left;
}

.mh-stats-place {
    width: 36px;
    color: var(--st-dim) !important;
    font-weight: 900 !important;
    font-variant-numeric: tabular-nums;
}

/* Récords de la modalidad */
.mh-stats-records {
    margin-top: 18px;
}

.mh-stats-records-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin-bottom: 10px;
}

.mh-stats-records-head h2 {
    margin: 0;
}

.mh-stats-records-head p {
    margin: 0;
    color: var(--st-dim);
    font-size: 0.82rem;
}

.mh-stats-records ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mh-stats-records a {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--st-border);
    border-radius: 12px;
    color: var(--st-text) !important;
    background: var(--st-surface);
    text-decoration: none !important;
}

.mh-stats-records a:hover,
.mh-stats-records a:focus-visible,
.mh-stats-records a[aria-current] {
    border-color: color-mix(in srgb, var(--st-accent) 55%, transparent);
}

.mh-stats-records img {
    border-radius: 6px;
    image-rendering: pixelated;
}

.mh-stats-records span {
    display: grid;
    min-width: 0;
}

.mh-stats-records small {
    overflow: hidden;
    color: var(--st-dim);
    font-size: 0.72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mh-stats-records strong {
    overflow: hidden;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mh-stats-records em {
    color: var(--st-hot);
    font-size: 0.86rem;
    font-style: normal;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
    .mh-stats-modebar {
        display: flex;
        margin-inline: -16px;
        padding-inline: 16px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .mh-stats-modebar a {
        flex: 0 0 150px;
        scroll-snap-align: start;
    }

    .mh-stats-board {
        grid-template-columns: 1fr;
    }

    .mh-stats-picker {
        gap: 10px;
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid var(--st-border);
    }

    .mh-stats-picker-group {
        display: grid;
        gap: 6px;
    }

    .mh-stats-picker h3 {
        margin: 0;
    }

    .mh-stats-picker ul {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .mh-stats-picker a {
        padding: 6px 12px;
        border: 1px solid var(--st-border);
        border-radius: 999px;
        white-space: nowrap;
    }

    .mh-stats-picker a[aria-current] {
        border-color: var(--st-accent);
    }

    .mh-stats-stage {
        padding: 18px 14px 20px;
    }
}

@media (max-width: 420px) {
    .mh-stats-podium {
        gap: 6px;
    }

    .mh-stats-podium-player img {
        height: 110px;
    }

    .is-place-1 .mh-stats-podium-player img {
        height: 134px;
    }

    .mh-stats-podium-player strong {
        font-size: 0.82rem;
    }

    .mh-stats-podium-player span {
        font-size: 0.78rem;
    }

    .mh-stats-podium-block {
        height: 72px;
        padding-top: 12px;
    }

    .is-place-1 .mh-stats-podium-block {
        height: 96px;
    }

    .is-place-3 .mh-stats-podium-block {
        height: 56px;
    }

    .mh-stats-podium-block b {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .is-place-1 .mh-stats-podium-block b {
        width: 38px;
        height: 38px;
    }
}

/* ---- Tono humano y movimiento ---------------------------------------- */
.mh-stats-story {
    margin: 10px 0 0;
    color: var(--st-muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.mh-stats-story strong {
    color: var(--st-text);
    font-weight: 800;
}

/* Cada jugador del podio respira como en el juego: un balanceo lento,
   desfasado por puesto para que no se muevan al unísono. */
.mh-stats-podium-figure {
    display: block;
    transform-origin: 50% 100%;
    animation: mh-stats-idle 4.2s ease-in-out infinite;
}

.is-place-2 .mh-stats-podium-figure { animation-delay: -1.4s; }
.is-place-3 .mh-stats-podium-figure { animation-delay: -2.8s; }

.mh-stats-podium-player:hover .mh-stats-podium-figure,
.mh-stats-podium-player:focus-visible .mh-stats-podium-figure {
    animation: mh-stats-hop 520ms cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

/* Brillo que cruza la medalla de oro cada pocos segundos. */
.is-gold .mh-stats-podium-block b {
    position: relative;
    overflow: hidden;
}

.is-gold .mh-stats-podium-block b::after {
    position: absolute;
    inset: 0 auto 0 -80%;
    width: 60%;
    background: linear-gradient(100deg, transparent, rgb(255 255 255 / 70%), transparent);
    content: '';
    transform: skewX(-18deg);
    animation: mh-stats-shine 5s ease-in-out 1.4s infinite;
}

.mh-stats-podium.is-empty .mh-stats-podium-block b::after {
    display: none;
}

/* La silueta vacía parpadea como un «¿quién será?». */
.mh-stats-podium-player.is-vacant i {
    animation: mh-stats-wonder 2.6s ease-in-out infinite;
}

.is-place-2 .mh-stats-podium-player.is-vacant i { animation-delay: 0.4s; }
.is-place-3 .mh-stats-podium-player.is-vacant i { animation-delay: 0.8s; }

/* Entradas escalonadas: filas, récords y fichas del perfil. */
.mh-stats-rise {
    animation: mh-stats-rise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 55ms + 250ms);
}

.mh-stats-records .mh-stats-rise {
    animation-delay: calc(var(--i, 0) * 45ms + 450ms);
}

/* Las barras de actividad crecen de izquierda a derecha. */
.mh-stats-activity li::after {
    transform-origin: 50% 100%;
    animation: mh-stats-grow 700ms cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
    animation-delay: calc(var(--i, 0) * 22ms + 200ms);
}

.mh-stats-activity li:hover::after {
    filter: brightness(1.25);
}

/* Las modalidades se levantan un poco al pasar por encima. */
.mh-stats-modebar a {
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.mh-stats-modebar a:hover,
.mh-stats-modebar a:focus-visible {
    transform: translateY(-3px);
}

.mh-stats-records a {
    transition: transform 160ms ease, border-color 160ms ease;
}

.mh-stats-records a:hover,
.mh-stats-records a:focus-visible {
    transform: translateY(-2px);
}

.mh-stats-records a:hover img {
    animation: mh-stats-hop 480ms cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes mh-stats-idle {
    0%, 100% { transform: rotate(-1.6deg) translateY(0); }
    50% { transform: rotate(1.6deg) translateY(-3px); }
}

@keyframes mh-stats-hop {
    0% { transform: translateY(0); }
    40% { transform: translateY(-12px); }
    100% { transform: translateY(0); }
}

@keyframes mh-stats-shine {
    0%, 70% { left: -80%; }
    100% { left: 140%; }
}

@keyframes mh-stats-wonder {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

@keyframes mh-stats-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes mh-stats-grow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
    .mh-stats-podium-figure,
    .mh-stats-podium-player.is-vacant i,
    .is-gold .mh-stats-podium-block b::after,
    .mh-stats-rise,
    .mh-stats-activity li::after,
    .mh-stats-records a:hover img,
    .mh-stats-podium-player:hover .mh-stats-podium-figure {
        animation: none !important;
    }

    .mh-stats-modebar a:hover,
    .mh-stats-records a:hover {
        transform: none;
    }
}

/* Suelo común del podio: una línea fina que asienta los pedestales. */
.mh-stats-podium::after {
    position: absolute;
    right: -8%;
    bottom: 0;
    left: -8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--st-border) 18%, var(--st-border) 82%, transparent);
    content: '';
}
