/* =========================================================
   TennisFinalsPro — Ranking final redesign
   Czysty plik: desktop + mobile pod zaakceptowaną grafikę.
   Bez zmiany logiki PHP/JS.
   ========================================================= */

:root {
    --rank-bg: #f4f8ff;
    --rank-white: #ffffff;
    --rank-ink: #061332;
    --rank-text: #122345;
    --rank-muted: #667797;
    --rank-line: #dfe8f6;
    --rank-line-soft: #edf3fb;
    --rank-blue: #075cff;
    --rank-blue-2: #1887ff;
    --rank-cyan: #24d5ee;
    --rank-green: #10b981;
    --rank-green-soft: #ddfbea;
    --rank-red: #ef4444;
    --rank-red-soft: #fee2e2;
    --rank-gold: #f5b91f;
    --rank-gold-soft: #fff7dd;
    --rank-silver: #94a3b8;
    --rank-silver-soft: #f1f5f9;
    --rank-bronze: #d97706;
    --rank-bronze-soft: #fff2df;
    --rank-shadow: 0 24px 60px rgba(15, 35, 73, .10);
    --rank-shadow-soft: 0 12px 30px rgba(15, 35, 73, .07);
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.tfp-ranking-body {
    margin: 0;
    color: var(--rank-text);
    background:
        radial-gradient(circle at 8% 0%, rgba(37, 99, 235, .08), transparent 20rem),
        radial-gradient(circle at 94% 4%, rgba(34, 211, 238, .12), transparent 24rem),
        linear-gradient(180deg, #fbfdff 0%, #f3f7ff 58%, #fbfdff 100%);
}

.tfp-ranking,
.tfp-ranking * {
    box-sizing: border-box;
}

.tfp-ranking {
    width: min(1120px, calc(100% - 56px));
    margin: 0 auto;
    padding: 28px 0 76px;
    font-family: var(--tfp-font-sans, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

/* HERO */
.tfp-ranking-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
    gap: 28px;
    align-items: center;
    min-height: 220px;
    margin: 0 0 22px;
    padding: 34px 34px;
    border-radius: 32px;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 211, 238, .34), transparent 26rem),
        radial-gradient(circle at 12% 0%, rgba(124, 58, 237, .26), transparent 24rem),
        linear-gradient(135deg, #1b2476 0%, #075cff 56%, #1ec8ed 100%);
    box-shadow: 0 26px 64px rgba(20, 72, 170, .18), inset 0 1px 0 rgba(255,255,255,.14);
}

.tfp-ranking-hero::before,
.tfp-ranking-hero::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
}

.tfp-ranking-hero::before {
    right: -120px;
    top: -164px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 0 70px rgba(34,211,238,.18);
}

.tfp-ranking-hero::after {
    left: -170px;
    bottom: -210px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(255,255,255,.09), transparent 66%);
}

.tfp-ranking-hero__content {
    min-width: 0;
}

.tfp-ranking-kicker {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    min-height: 30px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    color: #eaf4ff;
    background: rgba(255,255,255,.12);
    font-size: 11px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .065em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tfp-ranking-kicker::before {
    content: "🏆";
    margin-right: 8px;
    font-size: 13px;
    letter-spacing: 0;
}

.tfp-ranking-hero h1 {
    max-width: 720px;
    margin: 20px 0 10px;
    color: #fff;
    font-size: clamp(54px, 4.8vw, 72px);
    line-height: .94;
    font-weight: 950;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

.tfp-ranking-hero p {
    max-width: 720px;
    margin: 0;
    color: rgba(239, 246, 255, .94);
    font-size: 16px;
    line-height: 1.55;
    font-weight: 720;
    letter-spacing: -0.01em;
}

.tfp-ranking-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-self: stretch;
}

.tfp-ranking-hero__stats div {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 14px;
    align-content: center;
    min-height: 92px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 22px;
    background: rgba(255,255,255,.13);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.tfp-ranking-hero__stats div::before {
    content: "👥";
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 14px;
    background: rgba(255,255,255,.14);
    font-size: 18px;
}

.tfp-ranking-hero__stats div:nth-child(2)::before { content: "🎾"; }
.tfp-ranking-hero__stats div:nth-child(3)::before { content: "✅"; }

.tfp-ranking-hero__stats strong {
    display: block;
    color: #fff;
    font-size: 34px;
    line-height: .9;
    font-weight: 950;
    letter-spacing: -0.035em;
}

.tfp-ranking-hero__stats span {
    display: block;
    margin-top: 8px;
    color: #eaf4ff;
    font-size: 12px;
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: .035em;
    text-transform: uppercase;
}

/* PODIUM */
.tfp-ranking-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
    margin: 0 0 22px;
}

.tfp-podium-card {
    position: relative;
    display: grid;
    grid-template-columns: 50px 44px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    min-height: 106px;
    padding: 18px 20px;
    border: 1px solid var(--rank-line);
    border-radius: 22px;
    background: rgba(255,255,255,.98);
    color: var(--rank-text);
    text-decoration: none;
    box-shadow: var(--rank-shadow-soft);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.tfp-podium-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37,99,235,.28);
    box-shadow: 0 20px 44px rgba(15,35,73,.105);
}

.tfp-podium-card.is-rank-1 {
    order: 2;
    min-height: 112px;
    border-color: rgba(245,185,31,.38);
    background:
        radial-gradient(circle at 100% 0%, rgba(245,185,31,.12), transparent 13rem),
        rgba(255,255,255,.99);
}

.tfp-podium-card.is-rank-2 { order: 1; }
.tfp-podium-card.is-rank-3 { order: 3; }

.tfp-podium-card__rank {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--rank-silver-soft);
    color: var(--rank-silver);
    font-size: 0;
    font-weight: 950;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.tfp-podium-card__rank::before {
    content: attr(class);
    display: none;
}

.tfp-podium-card__rank {
    font-size: 18px;
}

.tfp-podium-card__rank::after {
    content: "";
}

.tfp-podium-card.is-rank-1 .tfp-podium-card__rank {
    background: linear-gradient(135deg, #ffd95e, #f5b91f);
    color: #fff;
    box-shadow: 0 10px 22px rgba(245,185,31,.25);
}

.tfp-podium-card.is-rank-2 .tfp-podium-card__rank {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #fff;
}

.tfp-podium-card.is-rank-3 .tfp-podium-card__rank {
    background: linear-gradient(135deg, #f6c08a, #d97706);
    color: #fff;
}

.tfp-podium-card__avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    color: var(--rank-blue);
    font-size: 15px;
    font-weight: 950;
}

.tfp-podium-card__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tfp-podium-card__name,
.tfp-podium-card strong {
    min-width: 0;
    overflow: visible;
    color: var(--rank-ink);
    font-size: 17px;
    line-height: 1.15;
    font-weight: 950;
    letter-spacing: -0.02em;
    text-overflow: clip;
    white-space: normal;
}

.tfp-podium-card em {
    color: var(--rank-blue);
    font-size: 22px;
    line-height: 1;
    font-style: normal;
    font-weight: 950;
    letter-spacing: -0.035em;
    white-space: nowrap;
}

/* PANEL */
.tfp-ranking-panel {
    padding: 22px;
    border: 1px solid var(--rank-line);
    border-radius: 30px;
    background: rgba(255,255,255,.98);
    box-shadow: var(--rank-shadow);
}

.tfp-ranking-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.tfp-ranking-panel .tfp-ranking-kicker {
    min-height: 24px;
    padding: 0 10px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--rank-blue);
    font-size: 11px;
}

.tfp-ranking-panel .tfp-ranking-kicker::before {
    content: none;
}

.tfp-ranking-panel h2 {
    margin: 7px 0 0;
    color: var(--rank-ink);
    font-size: 38px;
    line-height: .98;
    font-weight: 950;
    letter-spacing: -0.055em;
}

.tfp-ranking-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--rank-soft, #eef5ff);
    color: var(--rank-blue);
    font-size: 13px;
    line-height: 1;
    font-weight: 950;
    white-space: nowrap;
}

/* FILTERS */
.tfp-ranking-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1.35fr) repeat(4, minmax(130px, .72fr));
    gap: 14px;
    align-items: end;
    margin: 0 0 20px;
}

.tfp-ranking-search,
.tfp-ranking-filter {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.tfp-ranking-search span,
.tfp-ranking-filter span {
    color: #596b88;
    font-size: 11px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.tfp-ranking-search input,
.tfp-ranking-filter select {
    width: 100%;
    height: 46px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--rank-line);
    border-radius: 16px;
    background: #fff;
    color: var(--rank-ink);
    font-size: 14px;
    line-height: 1;
    font-weight: 850;
    outline: none;
    box-shadow: none;
}

.tfp-ranking-search input::placeholder {
    color: #94a3b8;
}

.tfp-ranking-search input:focus,
.tfp-ranking-filter select:focus {
    border-color: rgba(37,99,235,.56);
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

/* TABLE */
.tfp-ranking-table-card {
    overflow: hidden;
    border: 1px solid var(--rank-line);
    border-radius: 24px;
    background: #fff;
}

.tfp-ranking-table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--rank-line);
    background: #f8fbff;
}

.tfp-ranking-table-meta span {
    min-width: 0;
    overflow: hidden;
    color: var(--rank-muted);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tfp-ranking-table-meta button,
.tfp-ranking-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: #edf5ff;
    color: var(--rank-blue);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    font-weight: 950;
    white-space: nowrap;
}

.tfp-ranking-table-meta button:hover,
.tfp-ranking-pagination button:hover:not(:disabled) {
    background: var(--rank-blue);
    color: #fff;
}

.tfp-ranking-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tfp-ranking-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.tfp-ranking-table th,
.tfp-ranking-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--rank-line-soft);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.tfp-ranking-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fbff;
    color: #455875;
    font-size: 11px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tfp-ranking-table td {
    color: var(--rank-text);
    font-size: 14px;
    line-height: 1.3;
    font-weight: 780;
}

.tfp-ranking-table tbody tr:hover {
    background: #f8fbff;
}

.tfp-ranking-table .is-right {
    text-align: right;
}

.tfp-table-rank {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eef5ff;
    color: var(--rank-blue);
    font-size: 14px;
    line-height: 1;
    font-weight: 950;
}

.tfp-ranking-row.is-rank-1 .tfp-table-rank,
.tfp-ranking-table tr[data-rank="1"] .tfp-table-rank {
    background: linear-gradient(135deg, #ffd95e, #f5b91f);
    color: #fff;
}

.tfp-ranking-row.is-rank-2 .tfp-table-rank,
.tfp-ranking-table tr[data-rank="2"] .tfp-table-rank {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #fff;
}

.tfp-ranking-row.is-rank-3 .tfp-table-rank,
.tfp-ranking-table tr[data-rank="3"] .tfp-table-rank {
    background: linear-gradient(135deg, #f6c08a, #d97706);
    color: #fff;
}

.tfp-table-player-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tfp-table-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    color: var(--rank-blue);
    font-size: 14px;
    font-weight: 950;
    flex: 0 0 42px;
}

.tfp-table-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tfp-table-player-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.tfp-table-player {
    display: block;
    max-width: none;
    overflow: visible;
    color: var(--rank-ink);
    font-size: 14.5px;
    line-height: 1.15;
    font-weight: 950;
    letter-spacing: -0.015em;
    text-decoration: none;
    text-overflow: clip;
    white-space: normal;
}

.tfp-table-player:hover {
    color: var(--rank-blue);
}

.tfp-table-player-sub {
    color: #64748b;
    font-size: 11px;
    line-height: 1.15;
    font-weight: 850;
}

.tfp-level-badge {
    display: inline-grid;
    gap: 3px;
    min-width: 106px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.tfp-level-badge strong {
    color: var(--rank-ink);
    font-size: 11.5px;
    line-height: 1;
    font-weight: 950;
}

.tfp-level-badge small {
    color: var(--rank-muted);
    font-size: 9.5px;
    line-height: 1;
    font-weight: 900;
}

.tfp-level-badge--start { background: #f8fafc; border-color: #e2e8f0; }
.tfp-level-badge--recreational { background: #eff6ff; border-color: #bfdbfe; }
.tfp-level-badge--intermediate { background: #ecfeff; border-color: #a5f3fc; }
.tfp-level-badge--club { background: #f0fdf4; border-color: #bbf7d0; }
.tfp-level-badge--tournament { background: #fff7ed; border-color: #fed7aa; }

.tfp-table-points {
    color: var(--rank-blue);
    font-size: 20px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.035em;
}

.tfp-muted {
    color: var(--rank-muted);
}

.tfp-form {
    display: flex;
    gap: 5px;
}

.tfp-form span {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    font-weight: 950;
}

.tfp-form .is-win {
    background: var(--rank-green-soft);
    color: var(--rank-green);
}

.tfp-form .is-loss {
    background: var(--rank-red-soft);
    color: var(--rank-red);
}

.tfp-table-empty {
    padding: 24px !important;
    color: var(--rank-muted) !important;
    text-align: center !important;
}

/* PAGINATION */
.tfp-ranking-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--rank-line);
    background: #fff;
}

.tfp-ranking-pagination span {
    color: var(--rank-muted);
    font-size: 13px;
    line-height: 1;
    font-weight: 850;
    white-space: nowrap;
}

.tfp-ranking-pagination button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

/* TABLET */
@media (max-width: 1050px) {
    .tfp-ranking {
        width: min(100% - 32px, 820px);
        padding-top: 20px;
    }

    .tfp-ranking-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .tfp-ranking-hero__stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tfp-ranking-toolbar {
        grid-template-columns: minmax(250px, 1fr) repeat(2, minmax(140px, .7fr));
    }

    .tfp-ranking-search {
        grid-column: 1 / -1;
    }
}

/* MOBILE — zgodnie z życzeniem: bez wielkiego banera, bez wielkiej piłki */
@media (max-width: 699px) {
    .tfp-ranking-body {
        background:
            radial-gradient(circle at 10% 0%, rgba(37,99,235,.08), transparent 14rem),
            linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
    }

    .tfp-ranking {
        width: min(100% - 10px, 390px);
        max-width: 390px;
        padding: 5px 0 34px;
    }

    .tfp-ranking-hero {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        min-height: 0;
        margin: 0 0 8px;
        padding: 10px 10px;
        border-radius: 16px;
        background:
            radial-gradient(circle at 100% 0%, rgba(34,211,238,.20), transparent 8rem),
            linear-gradient(135deg, #11185c 0%, #1556d9 62%, #20c4df 100%);
        box-shadow: 0 10px 22px rgba(19, 60, 160, .12), inset 0 1px 0 rgba(255,255,255,.12);
    }

    .tfp-ranking-hero::before,
    .tfp-ranking-hero::after {
        content: none;
        display: none;
    }

    .tfp-ranking-kicker {
        min-height: 19px;
        padding: 0 8px;
        font-size: 7px;
        margin-bottom: 5px;
    }

    .tfp-ranking-kicker::before {
        margin-right: 5px;
        font-size: 9px;
    }

    .tfp-ranking-hero h1 {
        margin: 0;
        font-size: 23px;
        line-height: .98;
        letter-spacing: -0.04em;
    }

    .tfp-ranking-hero p {
        max-width: 100%;
        margin: 5px 0 0;
        font-size: 9px;
        line-height: 1.25;
        font-weight: 720;
    }

    .tfp-ranking-hero__stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .tfp-ranking-hero__stats div {
        grid-template-columns: 14px minmax(0, 1fr);
        column-gap: 5px;
        min-height: 31px;
        height: 31px;
        padding: 4px 5px;
        border-radius: 9px;
        background: rgba(255,255,255,.105);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .tfp-ranking-hero__stats div::before {
        width: 14px;
        height: 14px;
        border-radius: 5px;
        font-size: 7.5px;
    }

    .tfp-ranking-hero__stats strong {
        font-size: 13px;
        line-height: .95;
    }

    .tfp-ranking-hero__stats span {
        margin-top: 0;
        overflow: hidden;
        font-size: 5.5px;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tfp-ranking-podium {
        grid-template-columns: 1fr;
        gap: 7px;
        margin-bottom: 9px;
    }

    .tfp-podium-card,
    .tfp-podium-card.is-rank-1 {
        order: initial;
        grid-template-columns: 34px 32px minmax(0, 1fr) auto;
        gap: 9px;
        min-height: 56px;
        padding: 9px;
        border-radius: 16px;
    }

    .tfp-podium-card__rank {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .tfp-podium-card__avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .tfp-podium-card__name,
    .tfp-podium-card strong {
        font-size: 13.5px;
        line-height: 1.15;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .tfp-podium-card em {
        font-size: 12px;
    }

    .tfp-ranking-panel {
        padding: 10px;
        border-radius: 19px;
    }

    .tfp-ranking-panel-head {
        align-items: center;
        margin-bottom: 10px;
    }

    .tfp-ranking-panel h2 {
        font-size: 22px;
    }

    .tfp-ranking-count {
        min-height: 26px;
        padding: 0 9px;
        font-size: 10px;
    }

    .tfp-ranking-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 10px;
    }

    .tfp-ranking-search {
        grid-column: 1 / -1;
    }

    .tfp-ranking-search span,
    .tfp-ranking-filter span {
        font-size: 7px;
    }

    .tfp-ranking-search input,
    .tfp-ranking-filter select {
        height: 32px;
        min-height: 32px;
        padding: 0 9px;
        border-radius: 11px;
        font-size: 10.5px;
    }

    .tfp-ranking-table-card {
        overflow: visible;
        border: 0;
        background: transparent;
        border-radius: 0;
    }

    .tfp-ranking-table-meta {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        margin: 0 0 8px;
        padding: 9px;
        border: 1px solid var(--rank-line);
        border-radius: 15px;
        background: #f8fbff;
    }

    .tfp-ranking-table-meta span {
        font-size: 10.5px;
    }

    .tfp-ranking-table-meta button {
        min-height: 30px;
        padding: 0 10px;
        font-size: 10px;
    }

    .tfp-ranking-table-scroll {
        overflow: visible;
    }

    .tfp-ranking-table,
    .tfp-ranking-table tbody,
    .tfp-ranking-table tr,
    .tfp-ranking-table td {
        display: block;
        width: 100%;
    }

    .tfp-ranking-table {
        min-width: 0;
        border-collapse: separate;
    }

    .tfp-ranking-table thead {
        display: none;
    }

    .tfp-ranking-table tbody {
        display: grid;
        gap: 7px;
    }

    .tfp-ranking-table tr {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr) auto;
        grid-template-areas:
            "rank player points"
            "rank level points"
            "rank meta meta";
        gap: 5px 8px;
        min-height: 72px;
        padding: 9px;
        border: 1px solid var(--rank-line);
        border-radius: 17px;
        background: #fff;
        box-shadow: var(--rank-shadow-soft);
    }

    .tfp-ranking-table td {
        padding: 0;
        border: 0;
        white-space: normal;
    }

    .tfp-ranking-table td:nth-child(1) {
        grid-area: rank;
        align-self: center;
    }

    .tfp-ranking-table td:nth-child(2) {
        grid-area: player;
        align-self: end;
        min-width: 0;
    }

    .tfp-ranking-table td:nth-child(3) {
        grid-area: level;
        align-self: start;
    }

    .tfp-ranking-table td:nth-child(4),
    .tfp-ranking-table td:nth-child(5),
    .tfp-ranking-table td:nth-child(6) {
        grid-area: meta;
        display: inline-flex;
        width: auto;
        align-items: center;
        justify-content: center;
        min-height: 23px;
        margin-top: 1px;
        padding: 0 7px;
        border-radius: 999px;
        background: #f1f5ff;
        color: #334155;
        font-size: 9px;
        font-weight: 900;
    }

    .tfp-ranking-table td:nth-child(4)::before {
        content: 'Mecze ';
        margin-right: 2px;
        color: #64748b;
    }

    .tfp-ranking-table td:nth-child(5)::before {
        content: 'Bilans ';
        margin-right: 2px;
        color: #64748b;
    }

    .tfp-ranking-table td:nth-child(6)::before {
        content: 'WR ';
        margin-right: 2px;
        color: #64748b;
    }

    .tfp-ranking-table td:nth-child(7) {
        display: none;
    }

    .tfp-ranking-table td:nth-child(8) {
        grid-area: points;
        align-self: center;
        text-align: right;
    }

    .tfp-table-rank {
        min-width: 34px;
        width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .tfp-table-avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        font-size: 12px;
    }

    .tfp-table-player-wrap {
        gap: 8px;
    }

    .tfp-table-player {
        max-width: 100%;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        font-size: 13px;
        line-height: 1.12;
    }

    .tfp-table-player-sub {
        font-size: 9.5px;
        line-height: 1.15;
    }

    .tfp-level-badge {
        min-width: 0;
        max-width: 138px;
        padding: 5px 7px;
        border-radius: 11px;
    }

    .tfp-level-badge strong {
        font-size: 9.2px;
    }

    .tfp-level-badge small {
        font-size: 8px;
    }

    .tfp-table-points {
        font-size: 13px;
    }

    .tfp-ranking-pagination {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 8px;
        padding: 10px 0 0;
        border: 0;
        background: transparent;
    }

    .tfp-ranking-pagination button {
        width: 100%;
        min-height: 32px;
        padding: 0 10px;
        font-size: 10px;
    }

    .tfp-ranking-pagination span {
        align-self: center;
        font-size: 10px;
        text-align: center;
    }
}

@media (max-width: 370px) {
    .tfp-ranking {
        width: min(100% - 8px, 360px);
    }

    .tfp-ranking-hero {
        padding: 8px;
        border-radius: 15px;
    }

    .tfp-ranking-hero h1 {
        font-size: 20px;
    }

    .tfp-ranking-hero p {
        font-size: 8.2px;
    }

    .tfp-ranking-hero__stats div {
        grid-template-columns: 12px minmax(0, 1fr);
        column-gap: 4px;
        padding: 3px;
    }

    .tfp-ranking-hero__stats div::before {
        width: 12px;
        height: 12px;
        font-size: 6.5px;
    }

    .tfp-ranking-hero__stats strong {
        font-size: 11px;
    }

    .tfp-ranking-hero__stats span {
        font-size: 4.7px;
    }

    .tfp-podium-card,
    .tfp-podium-card.is-rank-1 {
        grid-template-columns: 32px minmax(0, 1fr) auto;
        gap: 7px;
    }

    .tfp-podium-card__rank {
        width: 31px;
        height: 31px;
    }

    .tfp-podium-card__name,
    .tfp-podium-card strong {
        font-size: 12.5px;
    }

    .tfp-podium-card em {
        font-size: 11px;
    }

    .tfp-ranking-table tr {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        padding: 8px;
    }
}


/* Ranking final consistency */
.tfp-ranking-panel .tfp-ranking-kicker { color: var(--rank-blue) !important; opacity: 1 !important; }
.tfp-podium-card__name,
.tfp-table-player { overflow: visible !important; text-overflow: clip !important; white-space: normal !important; }
.tfp-table-player-wrap { width: 100%; min-width: 0; }
.tfp-table-player-copy { min-width: 0; }
.tfp-table-avatar img,
.tfp-podium-card__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
@media (min-width: 1024px) {
    .tfp-table-player { max-width: 340px !important; }
    .tfp-podium-card { grid-template-columns: 50px 42px minmax(0, 1fr) auto !important; }
}
@media (max-width: 699px) {
    .tfp-podium-card,
    .tfp-podium-card.is-rank-1 { grid-template-columns: 34px 32px minmax(0, 1fr) auto !important; }
    .tfp-podium-card__avatar { display: grid !important; width: 32px !important; height: 32px !important; }
    .tfp-ranking-panel .tfp-ranking-kicker { min-height: 20px !important; padding: 0 8px !important; font-size: 9px !important; }
    .tfp-table-player { font-size: 13px !important; line-height: 1.12 !important; }
    .tfp-table-player-sub { font-size: 9.5px !important; color: #64748b !important; }
}

/* =========================================================
   TFP 2026 — PLAYER ZONE / RANKING
   Unified low hero + lighter typography + wide desktop.
   ========================================================= */
body.tfp-ranking-body {
    --pz-ink: #0b1830;
    --pz-text: #263750;
    --pz-muted: #6a7890;
    --pz-line: #dfe6f0;
    --pz-blue: #1769df;
    --pz-cyan: #20a9d8;
    margin: 0 !important;
    color: var(--pz-text) !important;
    background:
        radial-gradient(circle at 8% -5%, rgba(23,105,223,.075), transparent 25rem),
        radial-gradient(circle at 94% 2%, rgba(32,169,216,.065), transparent 24rem),
        linear-gradient(180deg, #fafcff 0%, #f5f8fc 46%, #f8fafc 100%) !important;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    letter-spacing: .004em !important;
}

body.tfp-ranking-body .tfp-ranking {
    width: min(1480px, calc(100% - 48px)) !important;
    max-width: 1480px !important;
    margin: 0 auto !important;
    padding: 22px 0 64px !important;
}

body.tfp-ranking-body .tfp-ranking-hero {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(360px, 520px) !important;
    align-items: center !important;
    gap: 24px !important;
    min-height: 112px !important;
    margin: 0 0 16px !important;
    padding: 20px 24px !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    border-radius: 22px !important;
    color: #fff !important;
    background:
        radial-gradient(circle at 90% -20%, rgba(47,196,232,.26), transparent 18rem),
        linear-gradient(135deg, #0b2349 0%, #123d77 62%, #0e789f 100%) !important;
    box-shadow: 0 18px 42px rgba(15,44,88,.14) !important;
}

body.tfp-ranking-body .tfp-ranking-hero::before {
    width: 240px !important;
    height: 240px !important;
    right: -110px !important;
    top: -145px !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    box-shadow: 0 0 0 36px rgba(255,255,255,.035) !important;
}
body.tfp-ranking-body .tfp-ranking-hero::after { display: none !important; }

body.tfp-ranking-body .tfp-ranking-kicker {
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: #bfe9ff !important;
    background: transparent !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: .13em !important;
    text-transform: uppercase !important;
}
body.tfp-ranking-body .tfp-ranking-kicker::before { display: none !important; }

body.tfp-ranking-body .tfp-ranking-hero h1 {
    max-width: 760px !important;
    margin: 6px 0 4px !important;
    color: #fff !important;
    font-size: clamp(31px, 2.7vw, 40px) !important;
    line-height: 1.02 !important;
    font-weight: 700 !important;
    letter-spacing: -.025em !important;
}
body.tfp-ranking-body .tfp-ranking-hero p {
    max-width: 760px !important;
    margin: 0 !important;
    color: rgba(234,243,255,.82) !important;
    font-size: 12.5px !important;
    line-height: 1.48 !important;
    font-weight: 500 !important;
    letter-spacing: .006em !important;
}

body.tfp-ranking-body .tfp-ranking-hero__stats {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    gap: 8px !important;
    align-self: center !important;
}
body.tfp-ranking-body .tfp-ranking-hero__stats div {
    min-height: 66px !important;
    padding: 11px 12px !important;
    grid-template-columns: 28px minmax(0,1fr) !important;
    column-gap: 9px !important;
    border: 1px solid rgba(255,255,255,.15) !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,.10) !important;
    box-shadow: none !important;
}
body.tfp-ranking-body .tfp-ranking-hero__stats div::before {
    width: 28px !important;
    height: 28px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    background: rgba(255,255,255,.12) !important;
}
body.tfp-ranking-body .tfp-ranking-hero__stats strong {
    font-size: 21px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    letter-spacing: -.015em !important;
}
body.tfp-ranking-body .tfp-ranking-hero__stats span {
    margin-top: 3px !important;
    color: rgba(236,247,255,.78) !important;
    font-size: 8px !important;
    line-height: 1.15 !important;
    font-weight: 650 !important;
    letter-spacing: .07em !important;
}

body.tfp-ranking-body .tfp-ranking-podium {
    gap: 10px !important;
    margin: 0 0 14px !important;
}
body.tfp-ranking-body .tfp-podium-card {
    grid-template-columns: 38px 38px minmax(0,1fr) auto !important;
    gap: 11px !important;
    min-height: 82px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--pz-line) !important;
    border-radius: 17px !important;
    background: #fff !important;
    box-shadow: 0 7px 20px rgba(17,39,75,.045) !important;
}
body.tfp-ranking-body .tfp-podium-card:hover {
    transform: translateY(-1px) !important;
    border-color: #bfd0e6 !important;
    box-shadow: 0 11px 26px rgba(17,39,75,.07) !important;
}
body.tfp-ranking-body .tfp-podium-card.is-rank-1 { min-height: 82px !important; }
body.tfp-ranking-body .tfp-podium-card__rank {
    width: 36px !important;
    height: 36px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}
body.tfp-ranking-body .tfp-podium-card__avatar { width: 38px !important; height: 38px !important; }
body.tfp-ranking-body .tfp-podium-card__name { font-size: 12.5px !important; font-weight: 650 !important; letter-spacing: 0 !important; }
body.tfp-ranking-body .tfp-podium-card__points { font-size: 18px !important; font-weight: 700 !important; letter-spacing: -.02em !important; }

body.tfp-ranking-body .tfp-ranking-panel {
    padding: 16px !important;
    border: 1px solid var(--pz-line) !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: 0 10px 30px rgba(17,39,75,.055) !important;
}
body.tfp-ranking-body .tfp-ranking-panel-head { margin-bottom: 12px !important; }
body.tfp-ranking-body .tfp-ranking-panel-head h2 {
    margin: 4px 0 0 !important;
    color: var(--pz-ink) !important;
    font-size: 25px !important;
    line-height: 1.04 !important;
    font-weight: 700 !important;
    letter-spacing: -.022em !important;
}
body.tfp-ranking-body .tfp-ranking-count {
    min-height: 30px !important;
    padding: 0 11px !important;
    border-radius: 10px !important;
    color: var(--pz-blue) !important;
    background: #eef5ff !important;
    font-size: 9.5px !important;
    font-weight: 650 !important;
}
body.tfp-ranking-body .tfp-ranking-toolbar {
    gap: 9px !important;
    margin-bottom: 12px !important;
}
body.tfp-ranking-body .tfp-ranking-search input,
body.tfp-ranking-body .tfp-ranking-filter select {
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 11px !important;
    border-color: var(--pz-line) !important;
    color: var(--pz-ink) !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    letter-spacing: .005em !important;
}
body.tfp-ranking-body .tfp-ranking-filter > span,
body.tfp-ranking-body .tfp-ranking-search > span {
    color: #75839a !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    letter-spacing: .09em !important;
}
body.tfp-ranking-body .tfp-ranking-table-card {
    border: 1px solid var(--pz-line) !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
body.tfp-ranking-body .tfp-ranking-table-meta {
    min-height: 42px !important;
    padding: 0 12px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid var(--pz-line) !important;
    font-size: 9.5px !important;
    font-weight: 500 !important;
}
body.tfp-ranking-body .tfp-ranking-table th {
    height: 38px !important;
    color: #65758d !important;
    background: #fbfcfe !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    letter-spacing: .09em !important;
}
body.tfp-ranking-body .tfp-ranking-table td {
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    color: #263750 !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
}
body.tfp-ranking-body .tfp-ranking-row:hover { background: #f8fbff !important; }
body.tfp-ranking-body .tfp-ranking-player-name { color: var(--pz-ink) !important; font-weight: 650 !important; }
body.tfp-ranking-body .tfp-ranking-points { font-weight: 700 !important; }

@media (max-width: 1040px) {
    body.tfp-ranking-body .tfp-ranking { width: min(100% - 32px, 980px) !important; }
    body.tfp-ranking-body .tfp-ranking-hero { grid-template-columns: 1fr !important; gap: 13px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats { width: 100% !important; }
    body.tfp-ranking-body .tfp-ranking-podium { grid-template-columns: 1fr !important; }
    body.tfp-ranking-body .tfp-podium-card,
    body.tfp-ranking-body .tfp-podium-card.is-rank-1 { order: initial !important; }
}

@media (max-width: 720px) {
    body.tfp-ranking-body .tfp-ranking { width: calc(100% - 20px) !important; padding: 12px 0 38px !important; }
    body.tfp-ranking-body .tfp-ranking-hero { min-height: 0 !important; padding: 17px !important; border-radius: 18px !important; margin-bottom: 11px !important; }
    body.tfp-ranking-body .tfp-ranking-hero h1 { font-size: 28px !important; letter-spacing: -.018em !important; }
    body.tfp-ranking-body .tfp-ranking-hero p { font-size: 11px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats { grid-template-columns: repeat(3, minmax(0,1fr)) !important; gap: 5px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats div { min-height: 54px !important; padding: 8px !important; grid-template-columns: 1fr !important; text-align: center !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats div::before { display: none !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats strong { font-size: 17px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats span { font-size: 6.5px !important; }
    body.tfp-ranking-body .tfp-podium-card { min-height: 70px !important; padding: 10px 11px !important; border-radius: 15px !important; grid-template-columns: 34px 34px minmax(0,1fr) auto !important; gap: 8px !important; }
    body.tfp-ranking-body .tfp-ranking-panel { padding: 12px !important; border-radius: 17px !important; }
    body.tfp-ranking-body .tfp-ranking-panel-head h2 { font-size: 22px !important; }
    body.tfp-ranking-body .tfp-ranking-toolbar { grid-template-columns: 1fr 1fr !important; }
    body.tfp-ranking-body .tfp-ranking-search { grid-column: 1 / -1 !important; }
    body.tfp-ranking-body .tfp-ranking-table-scroll { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
    body.tfp-ranking-body .tfp-ranking-table { min-width: 760px !important; }
}

/* Correct row selectors used by ranking.php */
body.tfp-ranking-body .tfp-podium-card em {
    color: var(--pz-blue) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    font-style: normal !important;
    font-weight: 700 !important;
    letter-spacing: -.02em !important;
}
body.tfp-ranking-body .tfp-table-player {
    color: var(--pz-ink) !important;
    font-size: 11.5px !important;
    font-weight: 650 !important;
    letter-spacing: -.002em !important;
}
body.tfp-ranking-body .tfp-table-player-sub {
    margin-top: 2px !important;
    color: var(--pz-muted) !important;
    font-size: 8.5px !important;
    font-weight: 500 !important;
    letter-spacing: .004em !important;
}
body.tfp-ranking-body .tfp-level-badge strong { font-weight: 650 !important; }
body.tfp-ranking-body .tfp-level-badge small { font-weight: 500 !important; }

/* =========================================================
   TFP 2026 — PLAYER ZONE SYNC / RANKING
   Same approved visual system as /leagues.
   ========================================================= */
body.tfp-ranking-body {
    --pz-bg:#f6f8fc; --pz-surface:rgba(255,255,255,.94); --pz-ink:#0b1830;
    --pz-text:#263750; --pz-muted:#6a7890; --pz-line:#dfe6f0;
    --pz-line-strong:#ccd8e7; --pz-blue:#1769df; --pz-cyan:#20a9d8;
    color:var(--pz-text) !important;
    background:linear-gradient(180deg,#fafcff 0%,#f5f8fc 46%,#f8fafc 100%) !important;
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;
    letter-spacing:.004em !important;
}
body.tfp-ranking-body .tfp-ranking {
    width:min(1480px,calc(100% - 48px)) !important;
    max-width:1480px !important;
    padding:22px 0 64px !important;
}
body.tfp-ranking-body .tfp-ranking-hero {
    grid-template-columns:minmax(0,1fr) minmax(330px,500px) !important;
    min-height:112px !important;
    margin-bottom:16px !important;
    padding:22px 26px !important;
    border-radius:22px !important;
    background:radial-gradient(circle at 90% -20%,rgba(47,196,232,.26),transparent 18rem),linear-gradient(135deg,#0b2349 0%,#123d77 62%,#0e789f 100%) !important;
    box-shadow:0 18px 42px rgba(15,44,88,.14) !important;
}
body.tfp-ranking-body .tfp-ranking-kicker { color:#bfe9ff !important; font-size:10px !important; letter-spacing:.13em !important; }
body.tfp-ranking-body .tfp-ranking-hero h1 { font-size:clamp(31px,2.7vw,40px) !important; font-weight:700 !important; letter-spacing:-.025em !important; }
body.tfp-ranking-body .tfp-ranking-hero p { font-size:13px !important; font-weight:500 !important; letter-spacing:.006em !important; }
body.tfp-ranking-body .tfp-ranking-hero__stats { gap:8px !important; }
body.tfp-ranking-body .tfp-ranking-hero__stats div { min-height:58px !important; padding:9px 10px !important; border-radius:12px !important; }
body.tfp-ranking-body .tfp-ranking-hero__stats strong { font-size:19px !important; }
body.tfp-ranking-body .tfp-ranking-hero__stats span { font-size:7.5px !important; letter-spacing:.065em !important; }
body.tfp-ranking-body .tfp-podium-card { min-height:78px !important; border-radius:16px !important; box-shadow:0 7px 20px rgba(17,39,75,.045) !important; }
body.tfp-ranking-body .tfp-ranking-panel { padding:0 16px 16px !important; border-radius:18px !important; }
body.tfp-ranking-body .tfp-ranking-panel-head {
    margin:0 -16px 12px !important;
    padding:12px 14px !important;
    border-radius:17px 17px 0 0 !important;
    color:#fff !important;
    background:linear-gradient(100deg,#0b2b63,#164f9d) !important;
}
body.tfp-ranking-body .tfp-ranking-panel-head h2 { color:#fff !important; font-size:16px !important; letter-spacing:-.014em !important; }
body.tfp-ranking-body .tfp-ranking-panel-head .tfp-ranking-kicker { color:rgba(231,241,255,.84) !important; font-size:8px !important; }
body.tfp-ranking-body .tfp-ranking-count { min-height:29px !important; color:#fff !important; background:rgba(255,255,255,.11) !important; font-size:9px !important; }
body.tfp-ranking-body .tfp-ranking-toolbar { grid-template-columns:minmax(290px,1.4fr) repeat(4,minmax(120px,.7fr)) !important; gap:10px !important; }
body.tfp-ranking-body .tfp-ranking-search input,
body.tfp-ranking-body .tfp-ranking-filter select { height:40px !important; min-height:40px !important; border-radius:11px !important; font-size:10.5px !important; font-weight:500 !important; }
body.tfp-ranking-body .tfp-ranking-filter > span,
body.tfp-ranking-body .tfp-ranking-search > span { font-size:7px !important; letter-spacing:.065em !important; }
body.tfp-ranking-body .tfp-ranking-table-card { border-radius:16px !important; }
body.tfp-ranking-body .tfp-ranking-table td { font-size:11px !important; font-weight:500 !important; }
body.tfp-ranking-body .tfp-ranking-player-name { font-weight:650 !important; }

@media (max-width:720px) {
    body.tfp-ranking-body .tfp-ranking { width:calc(100% - 20px) !important; padding:12px 0 38px !important; }
    body.tfp-ranking-body .tfp-ranking-hero { grid-template-columns:1fr !important; min-height:0 !important; padding:17px !important; margin-bottom:12px !important; border-radius:18px !important; gap:12px !important; }
    body.tfp-ranking-body .tfp-ranking-hero h1 { font-size:28px !important; letter-spacing:-.018em !important; }
    body.tfp-ranking-body .tfp-ranking-hero p { font-size:10px !important; line-height:1.4 !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats { grid-template-columns:repeat(3,minmax(0,1fr)) !important; gap:5px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats div { min-height:50px !important; padding:7px !important; grid-template-columns:1fr !important; text-align:center !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats div::before { display:none !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats strong { font-size:16px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats span { font-size:6px !important; }
    body.tfp-ranking-body .tfp-ranking-podium { grid-template-columns:1fr !important; gap:7px !important; }
    body.tfp-ranking-body .tfp-podium-card { min-height:65px !important; padding:9px 10px !important; border-radius:14px !important; }
    body.tfp-ranking-body .tfp-ranking-panel { padding:0 10px 10px !important; border-radius:16px !important; }
    body.tfp-ranking-body .tfp-ranking-panel-head { margin:0 -10px 10px !important; padding:10px 11px !important; border-radius:15px 15px 0 0 !important; }
    body.tfp-ranking-body .tfp-ranking-panel-head h2 { font-size:14px !important; }
    body.tfp-ranking-body .tfp-ranking-toolbar { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:6px 5px !important; margin-bottom:9px !important; }
    body.tfp-ranking-body .tfp-ranking-search { grid-column:1 / -1 !important; gap:3px !important; }
    body.tfp-ranking-body .tfp-ranking-filter { grid-column:auto !important; min-width:0 !important; gap:3px !important; }
    body.tfp-ranking-body .tfp-ranking-search > span,
    body.tfp-ranking-body .tfp-ranking-filter > span { overflow:hidden !important; font-size:6px !important; line-height:1.1 !important; letter-spacing:.035em !important; white-space:nowrap !important; text-overflow:ellipsis !important; }
    body.tfp-ranking-body .tfp-ranking-search input { height:39px !important; min-height:39px !important; font-size:10px !important; }
    body.tfp-ranking-body .tfp-ranking-filter select { width:100% !important; min-width:0 !important; height:36px !important; min-height:36px !important; padding:0 17px 0 5px !important; font-size:7.5px !important; font-weight:600 !important; }
    body.tfp-ranking-body .tfp-ranking-table th { font-size:7px !important; }
    body.tfp-ranking-body .tfp-ranking-table td { font-size:10px !important; }
}

/* =========================================================
   TFP 2026 — ranking hero exactly as compact player-zone hero
   ========================================================= */
body.tfp-ranking-body .tfp-ranking-hero {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    align-items: center !important;
    gap: 24px !important;
    min-height: 112px !important;
    height: auto !important;
    padding: 18px 24px !important;
    overflow: hidden !important;
}
body.tfp-ranking-body .tfp-ranking-hero__content {
    align-self: center !important;
    min-width: 0 !important;
}
body.tfp-ranking-body .tfp-ranking-kicker {
    width: auto !important;
    min-height: 22px !important;
    margin: 0 0 7px !important;
    padding: 0 10px !important;
    border: 1px solid rgba(255,255,255,.15) !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #d7f3ff !important;
    background: rgba(255,255,255,.10) !important;
    box-shadow: none !important;
    font-size: 8px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    letter-spacing: .11em !important;
    text-transform: uppercase !important;
}
body.tfp-ranking-body .tfp-ranking-kicker::before { display: none !important; content: none !important; }
body.tfp-ranking-body .tfp-ranking-hero h1 {
    margin: 0 !important;
    font-size: clamp(31px,2.7vw,40px) !important;
    line-height: 1.02 !important;
    font-weight: 700 !important;
    letter-spacing: -.025em !important;
}
body.tfp-ranking-body .tfp-ranking-hero p {
    display: none !important;
    margin: 0 !important;
}
body.tfp-ranking-body .tfp-ranking-hero__stats {
    width: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    align-self: center !important;
}
body.tfp-ranking-body .tfp-ranking-hero__stats div {
    width: auto !important;
    min-width: 106px !important;
    min-height: 48px !important;
    padding: 7px 11px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 2px !important;
}
body.tfp-ranking-body .tfp-ranking-hero__stats div::before { display: none !important; content: none !important; }
body.tfp-ranking-body .tfp-ranking-hero__stats strong {
    margin: 0 !important;
    font-size: 17px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
}
body.tfp-ranking-body .tfp-ranking-hero__stats span {
    margin: 0 !important;
    font-size: 6.5px !important;
    line-height: 1.15 !important;
    font-weight: 650 !important;
    letter-spacing: .06em !important;
}
@media (max-width:720px) {
    body.tfp-ranking-body .tfp-ranking-hero {
        grid-template-columns: 1fr !important;
        gap: 9px !important;
        min-height: 0 !important;
        padding: 14px !important;
    }
    body.tfp-ranking-body .tfp-ranking-kicker {
        min-height: 20px !important;
        padding: 0 8px !important;
        margin-bottom: 6px !important;
        font-size: 6.8px !important;
    }
    body.tfp-ranking-body .tfp-ranking-hero h1 { font-size: 27px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(3,minmax(0,1fr)) !important;
        gap: 5px !important;
    }
    body.tfp-ranking-body .tfp-ranking-hero__stats div {
        min-width: 0 !important;
        min-height: 43px !important;
        padding: 6px 7px !important;
        align-items: center !important;
        text-align: center !important;
    }
    body.tfp-ranking-body .tfp-ranking-hero__stats strong { font-size: 15px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats span { font-size: 5.8px !important; }
}

/* =========================================================
   TFP RANKING MOBILE PRO V10 — compact SaaS + transparent points
   ========================================================= */

body.tfp-ranking-body .tfp-ranking-rules {
    margin: 0 0 14px;
}

body.tfp-ranking-body .tfp-ranking-rules__details {
    overflow: hidden;
    border: 1px solid #d8e4f3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 39, 77, .055);
}

body.tfp-ranking-body .tfp-ranking-rules__details > summary {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background:
        radial-gradient(circle at 100% 0%, rgba(20, 184, 166, .10), transparent 10rem),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

body.tfp-ranking-body .tfp-ranking-rules__details > summary::-webkit-details-marker { display: none; }
body.tfp-ranking-body .tfp-ranking-rules__details > summary::marker { display: none; content: ''; }

body.tfp-ranking-body .tfp-ranking-rules__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, #2563eb, #06b6d4);
    box-shadow: 0 7px 16px rgba(37, 99, 235, .18);
    font-size: 15px;
    font-weight: 850;
    font-style: normal;
}

body.tfp-ranking-body .tfp-ranking-rules__summary-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

body.tfp-ranking-body .tfp-ranking-rules__summary-copy strong {
    color: #0f2749;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 780;
    letter-spacing: -.015em;
}

body.tfp-ranking-body .tfp-ranking-rules__summary-copy small {
    color: #6b7c94;
    font-size: 9.5px;
    line-height: 1.35;
    font-weight: 560;
}

body.tfp-ranking-body .tfp-ranking-rules__chevron {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid #dbe6f3;
    border-radius: 9px;
    color: #31557f;
    background: #fff;
    font-size: 14px;
    font-weight: 800;
    transition: transform .18s ease;
}

body.tfp-ranking-body .tfp-ranking-rules__details[open] .tfp-ranking-rules__chevron {
    transform: rotate(180deg);
}

body.tfp-ranking-body .tfp-ranking-rules__body {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 11px 12px 8px;
    border-top: 1px solid #edf2f8;
    background: #fbfdff;
}

body.tfp-ranking-body .tfp-ranking-rule {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 8px;
    min-height: 86px;
    padding: 10px;
    border: 1px solid #e3ebf5;
    border-radius: 14px;
    background: #fff;
}

body.tfp-ranking-body .tfp-ranking-rule > span {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 9px;
    color: #fff;
    background: #2563eb;
    font-size: 8px;
    font-weight: 850;
}

body.tfp-ranking-body .tfp-ranking-rule--league > span { background: #14b8a6; }
body.tfp-ranking-body .tfp-ranking-rule--tournament > span { background: #8b5cf6; }
body.tfp-ranking-body .tfp-ranking-rule--bonus > span { background: #f59e0b; }

body.tfp-ranking-body .tfp-ranking-rule strong {
    display: block;
    margin: 1px 0 4px;
    color: #173253;
    font-size: 10.5px;
    line-height: 1.2;
    font-weight: 760;
}

body.tfp-ranking-body .tfp-ranking-rule p {
    margin: 0;
    color: #718096;
    font-size: 8.5px;
    line-height: 1.42;
    font-weight: 520;
}

body.tfp-ranking-body .tfp-ranking-rule p b { color: #173253; font-weight: 780; }

body.tfp-ranking-body .tfp-ranking-rules__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 12px 12px;
    background: #fbfdff;
}

body.tfp-ranking-body .tfp-ranking-rules__footer p {
    margin: 0;
    padding: 9px 10px;
    border-radius: 12px;
    color: #62738b;
    background: #f2f7fd;
    font-size: 8.5px;
    line-height: 1.42;
    font-weight: 520;
}

body.tfp-ranking-body .tfp-ranking-rules__footer strong { color: #244565; font-weight: 760; }

@media (max-width: 720px) {
    body.tfp-ranking-body .tfp-ranking {
        width: calc(100% - 16px) !important;
        max-width: none !important;
        padding: 9px 0 30px !important;
    }

    /* Hero — compact and readable */
    body.tfp-ranking-body .tfp-ranking-hero {
        gap: 8px !important;
        margin-bottom: 8px !important;
        padding: 12px !important;
        border-radius: 16px !important;
    }
    body.tfp-ranking-body .tfp-ranking-kicker {
        min-height: 18px !important;
        margin-bottom: 5px !important;
        padding: 0 7px !important;
        font-size: 6.3px !important;
    }
    body.tfp-ranking-body .tfp-ranking-hero h1 {
        font-size: 23px !important;
        line-height: 1.02 !important;
        letter-spacing: -.03em !important;
    }
    body.tfp-ranking-body .tfp-ranking-hero__stats { gap: 4px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats div {
        min-height: 39px !important;
        padding: 5px 4px !important;
        border-radius: 10px !important;
    }
    body.tfp-ranking-body .tfp-ranking-hero__stats strong { font-size: 14px !important; }
    body.tfp-ranking-body .tfp-ranking-hero__stats span { font-size: 5.5px !important; }

    /* Top 3 — one clean compact row per player */
    body.tfp-ranking-body .tfp-ranking-podium {
        gap: 5px !important;
        margin-bottom: 8px !important;
    }
    body.tfp-ranking-body .tfp-podium-card,
    body.tfp-ranking-body .tfp-podium-card.is-rank-1 {
        grid-template-columns: 30px 30px minmax(0, 1fr) auto !important;
        gap: 7px !important;
        min-height: 50px !important;
        padding: 7px 9px !important;
        border-radius: 13px !important;
    }
    body.tfp-ranking-body .tfp-podium-card__rank {
        width: 30px !important;
        height: 30px !important;
        font-size: 11px !important;
    }
    body.tfp-ranking-body .tfp-podium-card__avatar {
        width: 30px !important;
        height: 30px !important;
        font-size: 10px !important;
    }
    body.tfp-ranking-body .tfp-podium-card__name,
    body.tfp-ranking-body .tfp-podium-card strong {
        font-size: 11px !important;
        line-height: 1.15 !important;
    }
    body.tfp-ranking-body .tfp-podium-card em {
        font-size: 11px !important;
        font-weight: 780 !important;
        white-space: nowrap !important;
    }

    /* Scoring explainer */
    body.tfp-ranking-body .tfp-ranking-rules { margin-bottom: 8px !important; }
    body.tfp-ranking-body .tfp-ranking-rules__details { border-radius: 14px !important; }
    body.tfp-ranking-body .tfp-ranking-rules__details > summary {
        grid-template-columns: 28px minmax(0, 1fr) 24px !important;
        gap: 8px !important;
        min-height: 52px !important;
        padding: 8px 9px !important;
    }
    body.tfp-ranking-body .tfp-ranking-rules__icon {
        width: 28px !important;
        height: 28px !important;
        border-radius: 9px !important;
        font-size: 12px !important;
    }
    body.tfp-ranking-body .tfp-ranking-rules__summary-copy strong { font-size: 11px !important; }
    body.tfp-ranking-body .tfp-ranking-rules__summary-copy small {
        display: block !important;
        overflow: hidden !important;
        font-size: 7.8px !important;
        line-height: 1.3 !important;
    }
    body.tfp-ranking-body .tfp-ranking-rules__chevron {
        width: 24px !important;
        height: 24px !important;
        border-radius: 8px !important;
        font-size: 12px !important;
    }
    body.tfp-ranking-body .tfp-ranking-rules__body {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        padding: 8px 8px 6px !important;
    }
    body.tfp-ranking-body .tfp-ranking-rule {
        grid-template-columns: 23px minmax(0, 1fr) !important;
        gap: 6px !important;
        min-height: 0 !important;
        padding: 8px !important;
        border-radius: 11px !important;
    }
    body.tfp-ranking-body .tfp-ranking-rule > span {
        width: 23px !important;
        height: 23px !important;
        border-radius: 7px !important;
        font-size: 7px !important;
    }
    body.tfp-ranking-body .tfp-ranking-rule strong { font-size: 9px !important; }
    body.tfp-ranking-body .tfp-ranking-rule p { font-size: 7.4px !important; line-height: 1.35 !important; }
    body.tfp-ranking-body .tfp-ranking-rules__footer {
        grid-template-columns: 1fr !important;
        gap: 5px !important;
        padding: 0 8px 8px !important;
    }
    body.tfp-ranking-body .tfp-ranking-rules__footer p {
        padding: 7px 8px !important;
        border-radius: 10px !important;
        font-size: 7.4px !important;
        line-height: 1.35 !important;
    }

    /* Ranking panel */
    body.tfp-ranking-body .tfp-ranking-panel {
        padding: 0 8px 8px !important;
        border-radius: 15px !important;
    }
    body.tfp-ranking-body .tfp-ranking-panel-head {
        margin: 0 -8px 8px !important;
        padding: 9px 10px !important;
        border-radius: 14px 14px 0 0 !important;
    }
    body.tfp-ranking-body .tfp-ranking-panel-head h2 { font-size: 14px !important; }
    body.tfp-ranking-body .tfp-ranking-count {
        min-height: 25px !important;
        padding: 0 8px !important;
        font-size: 7.5px !important;
    }

    /* Filters: 2 columns instead of four cramped fields */
    body.tfp-ranking-body .tfp-ranking-toolbar {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
    }
    body.tfp-ranking-body .tfp-ranking-search { grid-column: 1 / -1 !important; }
    body.tfp-ranking-body .tfp-ranking-filter { grid-column: auto !important; }
    body.tfp-ranking-body .tfp-ranking-search > span,
    body.tfp-ranking-body .tfp-ranking-filter > span {
        font-size: 6.5px !important;
        line-height: 1 !important;
        letter-spacing: .04em !important;
    }
    body.tfp-ranking-body .tfp-ranking-search input,
    body.tfp-ranking-body .tfp-ranking-filter select {
        width: 100% !important;
        min-width: 0 !important;
        height: 35px !important;
        min-height: 35px !important;
        padding: 0 9px !important;
        border-radius: 10px !important;
        font-size: 9.5px !important;
        font-weight: 600 !important;
    }
    body.tfp-ranking-body .tfp-ranking-filter select { padding-right: 24px !important; }

    body.tfp-ranking-body .tfp-ranking-table-card {
        overflow: visible !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
    body.tfp-ranking-body .tfp-ranking-table-meta {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        min-height: 34px !important;
        margin-bottom: 6px !important;
        padding: 6px 7px !important;
        border: 1px solid #e1e9f4 !important;
        border-radius: 11px !important;
        background: #f8fbff !important;
    }
    body.tfp-ranking-body .tfp-ranking-table-meta span { font-size: 8.5px !important; }
    body.tfp-ranking-body .tfp-ranking-table-meta button {
        min-height: 25px !important;
        padding: 0 7px !important;
        border-radius: 8px !important;
        font-size: 7.5px !important;
    }

    /* Replace the fake desktop table with real compact mobile cards */
    body.tfp-ranking-body .tfp-ranking-table-scroll {
        overflow: visible !important;
        width: 100% !important;
    }
    body.tfp-ranking-body .tfp-ranking-table,
    body.tfp-ranking-body .tfp-ranking-table tbody,
    body.tfp-ranking-body .tfp-ranking-table tr,
    body.tfp-ranking-body .tfp-ranking-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    body.tfp-ranking-body .tfp-ranking-table {
        min-width: 0 !important;
        border: 0 !important;
        border-collapse: separate !important;
    }
    body.tfp-ranking-body .tfp-ranking-table thead { display: none !important; }
    body.tfp-ranking-body .tfp-ranking-table tbody {
        display: grid !important;
        gap: 6px !important;
    }
    body.tfp-ranking-body .tfp-ranking-table tr {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 31px minmax(0, 1fr) auto !important;
        grid-template-areas:
            "rank player points"
            "rank level points"
            "stats stats stats" !important;
        gap: 3px 7px !important;
        min-height: 0 !important;
        padding: 8px 9px 7px !important;
        border: 1px solid #dfe8f3 !important;
        border-radius: 13px !important;
        background: #fff !important;
        box-shadow: 0 4px 12px rgba(22, 45, 82, .035) !important;
    }
    body.tfp-ranking-body .tfp-ranking-table tr::after {
        content: "Mecze " attr(data-matches) "   •   Bilans " attr(data-wins) "-" attr(data-losses) "   •   WR " attr(data-winrate) "%" !important;
        grid-area: stats !important;
        display: block !important;
        min-width: 0 !important;
        margin-top: 3px !important;
        padding-top: 6px !important;
        border-top: 1px solid #edf2f8 !important;
        color: #6b7b91 !important;
        font-size: 8.2px !important;
        line-height: 1.15 !important;
        font-weight: 650 !important;
        letter-spacing: .005em !important;
        white-space: nowrap !important;
    }
    body.tfp-ranking-body .tfp-ranking-table td {
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    body.tfp-ranking-body .tfp-ranking-table td:nth-child(1) {
        grid-area: rank !important;
        align-self: center !important;
    }
    body.tfp-ranking-body .tfp-ranking-table td:nth-child(2) {
        grid-area: player !important;
        align-self: end !important;
    }
    body.tfp-ranking-body .tfp-ranking-table td:nth-child(3) {
        grid-area: level !important;
        align-self: start !important;
    }
    body.tfp-ranking-body .tfp-ranking-table td:nth-child(4),
    body.tfp-ranking-body .tfp-ranking-table td:nth-child(5),
    body.tfp-ranking-body .tfp-ranking-table td:nth-child(6),
    body.tfp-ranking-body .tfp-ranking-table td:nth-child(7) {
        display: none !important;
    }
    body.tfp-ranking-body .tfp-ranking-table td:nth-child(8) {
        grid-area: points !important;
        align-self: center !important;
        width: auto !important;
        text-align: right !important;
    }
    body.tfp-ranking-body .tfp-table-rank {
        display: grid !important;
        place-items: center !important;
        width: 31px !important;
        min-width: 31px !important;
        height: 31px !important;
        border-radius: 10px !important;
        font-size: 10px !important;
        font-weight: 780 !important;
    }
    body.tfp-ranking-body .tfp-table-player-wrap { gap: 7px !important; }
    body.tfp-ranking-body .tfp-table-avatar {
        width: 31px !important;
        height: 31px !important;
        flex: 0 0 31px !important;
        border-radius: 10px !important;
        font-size: 10px !important;
    }
    body.tfp-ranking-body .tfp-table-player {
        max-width: 100% !important;
        font-size: 10.5px !important;
        line-height: 1.12 !important;
        font-weight: 730 !important;
        white-space: normal !important;
    }
    body.tfp-ranking-body .tfp-table-player-sub {
        margin-top: 2px !important;
        font-size: 7.4px !important;
        line-height: 1 !important;
        color: #8290a4 !important;
    }
    body.tfp-ranking-body .tfp-level-badge {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        width: auto !important;
        max-width: 118px !important;
        min-height: 20px !important;
        padding: 2px 6px !important;
        border-radius: 7px !important;
    }
    body.tfp-ranking-body .tfp-level-badge strong {
        font-size: 7.5px !important;
        line-height: 1 !important;
        font-weight: 720 !important;
    }
    body.tfp-ranking-body .tfp-level-badge small {
        font-size: 6.5px !important;
        line-height: 1 !important;
        font-weight: 560 !important;
    }
    body.tfp-ranking-body .tfp-table-points {
        display: inline-flex !important;
        align-items: baseline !important;
        gap: 2px !important;
        color: #0f64df !important;
        font-size: 13px !important;
        line-height: 1 !important;
        font-weight: 820 !important;
        white-space: nowrap !important;
    }
    body.tfp-ranking-body .tfp-table-points::after {
        content: " pkt" !important;
        color: #5d7ca5 !important;
        font-size: 6.8px !important;
        font-weight: 680 !important;
    }

    body.tfp-ranking-body .tfp-ranking-pagination {
        grid-template-columns: 1fr auto 1fr !important;
        gap: 6px !important;
        padding-top: 8px !important;
    }
    body.tfp-ranking-body .tfp-ranking-pagination button {
        min-height: 32px !important;
        padding: 0 8px !important;
        border-radius: 9px !important;
        font-size: 8.5px !important;
    }
    body.tfp-ranking-body .tfp-ranking-pagination span { font-size: 8px !important; }
}

@media (max-width: 370px) {
    body.tfp-ranking-body .tfp-ranking-toolbar { grid-template-columns: 1fr !important; }
    body.tfp-ranking-body .tfp-ranking-filter { grid-column: 1 / -1 !important; }
    body.tfp-ranking-body .tfp-ranking-rules__body { grid-template-columns: 1fr !important; }
    body.tfp-ranking-body .tfp-ranking-table tr {
        grid-template-columns: 29px minmax(0,1fr) auto !important;
        padding-left: 7px !important;
        padding-right: 7px !important;
    }
    body.tfp-ranking-body .tfp-ranking-table tr::after { font-size: 7.5px !important; }
}
