:root {
    --tfp-bg: #eef5ff;
    --tfp-surface: rgba(255,255,255,0.92);
    --tfp-surface-strong: #ffffff;
    --tfp-line: #dbe7ff;
    --tfp-line-strong: #bfd4ff;
    --tfp-primary: #1e63ff;
    --tfp-primary-2: #0d48d6;
    --tfp-primary-soft: #eff5ff;
    --tfp-text: #0f172a;
    --tfp-muted: #5b6b88;
    --tfp-success: #18a957;
    --tfp-shadow: 0 24px 60px rgba(16, 33, 87, 0.12);
    --tfp-radius-xl: 28px;
    --tfp-radius-lg: 22px;
    --tfp-radius-md: 16px;
    --tfp-radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body[data-page="tournament-share-summary"] {
    font-family: 'Inter', Arial, sans-serif;
    color: var(--tfp-text);
    background:
        radial-gradient(circle at top right, rgba(30,99,255,0.15), transparent 28%),
        radial-gradient(circle at bottom left, rgba(30,99,255,0.12), transparent 24%),
        linear-gradient(180deg, #f7fbff 0%, var(--tfp-bg) 100%);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.tfp-share-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 18px 40px;
}

.tfp-share-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.tfp-share-back,
.tfp-share-btn {
    border-radius: 999px;
    border: 1px solid var(--tfp-line-strong);
    background: rgba(255,255,255,0.8);
    min-height: 48px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    color: var(--tfp-text);
    box-shadow: 0 10px 20px rgba(18, 45, 105, 0.08);
}

.tfp-share-btn { cursor: pointer; }
.tfp-share-btn--primary {
    background: linear-gradient(135deg, var(--tfp-primary), #2db7ff);
    border-color: transparent;
    color: #fff;
}
.tfp-share-btn--ghost:hover,
.tfp-share-back:hover { background: #fff; }
.tfp-share-btn[disabled] { opacity: 0.7; cursor: wait; }

.tfp-share-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.tfp-share-poster {
    background:
        radial-gradient(circle at top right, rgba(47,117,255,0.11), transparent 24%),
        radial-gradient(circle at 10% 92%, rgba(47,117,255,0.09), transparent 22%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,250,255,0.96));
    border: 1px solid rgba(200,220,255,0.9);
    border-radius: 34px;
    box-shadow: var(--tfp-shadow);
    padding: 30px;
    overflow: hidden;
    position: relative;
}

.tfp-share-poster::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(30,99,255,0.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(30,99,255,0.035) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0));
}

.tfp-share-brand-row,
.tfp-share-hero,
.tfp-share-winner-card,
.tfp-share-round-tabs,
.tfp-share-bracket-wrap,
.tfp-share-footer {
    position: relative;
    z-index: 1;
}

.tfp-share-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.tfp-share-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tfp-share-brand__logo,
.tfp-share-footer__logo {
    width: auto;
    display: block;
}

.tfp-share-brand__logo { height: 52px; }
.tfp-share-footer__logo { height: 40px; }

.tfp-share-brand__word {
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
    color: var(--tfp-primary);
    letter-spacing: -0.04em;
}

.tfp-share-status-badge {
    border: 1px solid var(--tfp-line-strong);
    background: rgba(255,255,255,0.88);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--tfp-primary-2);
}

.tfp-share-hero h1 {
    margin: 0;
    font-size: clamp(40px, 7vw, 76px);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.tfp-share-eyebrow {
    margin: 0 0 10px;
    color: var(--tfp-primary);
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.tfp-share-subtitle {
    margin: 12px 0 0;
    max-width: 700px;
    color: var(--tfp-muted);
    font-size: 18px;
}

.tfp-share-winner-card {
    margin-top: 28px;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 22px;
    border-radius: var(--tfp-radius-xl);
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(193, 213, 255, 0.9);
    padding: 22px;
    box-shadow: 0 20px 40px rgba(26, 52, 122, 0.10);
}

.tfp-share-trophy-box {
    min-height: 240px;
    border-radius: 26px;
    background: linear-gradient(180deg, #1f66ff 0%, #0f47d4 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
}

.tfp-share-trophy { font-size: 88px; line-height: 1; }
.tfp-share-trophy-box span { font-size: 18px; font-weight: 700; opacity: 0.95; }

.tfp-share-winner-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--tfp-primary), #2db7ff);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
}

.tfp-share-winner-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 18px;
}

.tfp-share-winner-lines strong {
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.tfp-share-score-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 20px;
}

.tfp-share-score-pill,
.tfp-share-finalist-pill {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--tfp-line-strong);
    background: var(--tfp-primary-soft);
    color: var(--tfp-primary-2);
    font-weight: 800;
}

.tfp-share-finalist-pill { background: #fff; color: var(--tfp-text); }

.tfp-share-round-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0 2px;
    margin-top: 26px;
    scrollbar-width: thin;
}

.tfp-share-round-tab {
    flex: 0 0 auto;
    border: 1px solid var(--tfp-line-strong);
    background: rgba(255,255,255,0.9);
    color: var(--tfp-text);
    border-radius: 999px;
    min-height: 46px;
    padding: 0 18px;
    font-weight: 800;
    cursor: pointer;
    transition: 180ms ease;
}

.tfp-share-round-tab.is-active,
.tfp-share-round-tab:hover {
    background: linear-gradient(135deg, var(--tfp-primary), #2db7ff);
    color: #fff;
    border-color: transparent;
}

.tfp-share-bracket-wrap {
    margin-top: 18px;
    padding: 20px;
    border-radius: 28px;
    border: 1px solid rgba(193, 213, 255, 0.9);
    background: rgba(255,255,255,0.78);
}

.tfp-share-bracket-grid {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.tfp-share-round-column {
    flex: 0 0 290px;
    min-width: 290px;
}

.tfp-share-round-heading {
    min-height: 48px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--tfp-primary), #2db7ff);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 16px;
}

.tfp-share-round-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tfp-share-match-card {
    border-radius: var(--tfp-radius-lg);
    background: var(--tfp-surface-strong);
    border: 1px solid rgba(200,220,255,0.95);
    box-shadow: 0 16px 30px rgba(16, 33, 87, 0.08);
    padding: 14px;
}

.tfp-share-match-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--tfp-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.tfp-share-match-top strong {
    color: var(--tfp-primary-2);
    font-size: 13px;
}

.tfp-share-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 14px;
    padding: 10px 12px;
    background: #f8fbff;
    border: 1px solid #edf4ff;
}

.tfp-share-team-row + .tfp-share-team-row { margin-top: 8px; }

.tfp-share-team-row.is-winner {
    background: linear-gradient(90deg, rgba(23,169,87,0.12), rgba(23,169,87,0.04));
    border-color: rgba(23,169,87,0.24);
}

.tfp-share-team-names {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tfp-share-team-names span {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--tfp-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tfp-share-team-row em {
    flex: 0 0 auto;
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--tfp-primary-soft);
    color: var(--tfp-primary-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-weight: 800;
}

.tfp-share-team-row.is-winner em {
    background: var(--tfp-success);
    color: #fff;
}

.tfp-share-footer {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(191, 212, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tfp-share-footer__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tfp-share-footer__brand strong {
    display: block;
    color: var(--tfp-primary);
    font-size: 20px;
    font-weight: 900;
}

.tfp-share-footer__brand span,
.tfp-share-footer__meta {
    color: var(--tfp-muted);
    font-size: 14px;
    font-weight: 600;
}

.tfp-share-empty {
    margin-top: 20px;
    border-radius: 22px;
    border: 1px dashed var(--tfp-line-strong);
    background: rgba(255,255,255,0.9);
    padding: 28px;
    color: var(--tfp-muted);
    text-align: center;
    font-weight: 700;
}

@media (max-width: 900px) {
    .tfp-share-poster { padding: 22px; border-radius: 28px; }
    .tfp-share-brand__logo { height: 44px; }
    .tfp-share-brand__word { font-size: 28px; }
    .tfp-share-status-badge { display: none; }
    .tfp-share-winner-card { grid-template-columns: 1fr; }
    .tfp-share-trophy-box { min-height: 150px; }
}

@media (max-width: 640px) {
    .tfp-share-page { padding: 16px 12px 30px; }
    .tfp-share-topbar { align-items: stretch; }
    .tfp-share-actions { width: 100%; justify-content: stretch; }
    .tfp-share-actions > * { flex: 1 1 calc(50% - 8px); }
    .tfp-share-back { width: 100%; justify-content: center; }
    .tfp-share-poster { padding: 18px; border-radius: 24px; }
    .tfp-share-brand-row { flex-direction: column; align-items: flex-start; }
    .tfp-share-brand__word { font-size: 22px; }
    .tfp-share-winner-lines strong { font-size: 38px; }
    .tfp-share-bracket-wrap { padding: 14px; border-radius: 22px; }
    .tfp-share-round-column { flex-basis: 260px; min-width: 260px; }
    .tfp-share-footer { flex-direction: column; align-items: flex-start; }
}

@media print {
    .no-capture,
    .tfp-share-topbar { display: none !important; }
    body[data-page="tournament-share-summary"] { background: #fff; }
    .tfp-share-page { padding: 0; max-width: none; }
    .tfp-share-poster { box-shadow: none; border: 0; }
}


/* === TFP: kompaktowa grafika 4:5 do WhatsApp, nie długa strona === */
.tfp-share-page {
    max-width: 760px;
}

.tfp-share-topbar {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.tfp-share-poster--compact {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 16px !important;
    border-radius: 28px !important;
    aspect-ratio: 4 / 5;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tfp-share-poster--compact .tfp-share-brand-row {
    margin-bottom: 2px;
}

.tfp-share-poster--compact .tfp-share-brand {
    gap: 8px;
}

.tfp-share-poster--compact .tfp-share-brand__logo {
    height: 28px !important;
    max-width: 150px;
    object-fit: contain;
}

.tfp-share-poster--compact .tfp-share-brand__word {
    display: none;
}

.tfp-share-poster--compact .tfp-share-status-badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 9px;
    font-size: 9px;
}

.tfp-share-poster--compact .tfp-share-hero h1 {
    font-size: clamp(25px, 7vw, 38px) !important;
    line-height: .95;
    letter-spacing: -.065em;
}

.tfp-share-poster--compact .tfp-share-eyebrow {
    margin: 0 0 4px;
    font-size: 10px;
    letter-spacing: .13em;
}

.tfp-share-poster--compact .tfp-share-subtitle {
    display: none;
}

.tfp-share-poster--compact .tfp-share-winner-card {
    margin-top: 4px !important;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    padding: 10px !important;
    border-radius: 20px !important;
}

.tfp-share-poster--compact .tfp-share-trophy-box {
    min-height: 0 !important;
    height: 118px;
    border-radius: 16px;
    gap: 4px;
}

.tfp-share-poster--compact .tfp-share-trophy {
    font-size: 46px;
}

.tfp-share-poster--compact .tfp-share-trophy-box span {
    font-size: 10px;
}

.tfp-share-poster--compact .tfp-share-winner-chip {
    padding: 6px 10px;
    font-size: 10px;
}

.tfp-share-poster--compact .tfp-share-winner-lines {
    margin-top: 8px;
    gap: 1px;
}

.tfp-share-poster--compact .tfp-share-winner-lines strong {
    font-size: clamp(22px, 6vw, 32px) !important;
    line-height: .98;
    letter-spacing: -.055em;
}

.tfp-share-poster--compact .tfp-share-score-row {
    margin-top: 8px;
    gap: 6px;
}

.tfp-share-poster--compact .tfp-share-score-pill,
.tfp-share-poster--compact .tfp-share-finalist-pill {
    min-height: 28px;
    padding: 0 9px;
    font-size: 10px;
    border-radius: 999px;
}

.tfp-share-poster--compact .tfp-share-finalist-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tfp-share-poster--compact .tfp-share-round-tabs {
    margin-top: 0;
    padding: 0;
    gap: 6px;
}

.tfp-share-poster--compact .tfp-share-round-tab {
    min-height: 28px;
    padding: 0 10px;
    font-size: 10px;
}

.tfp-share-poster--compact .tfp-share-bracket-wrap {
    margin-top: 0;
    padding: 9px;
    border-radius: 18px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.tfp-share-poster--compact .tfp-share-bracket-grid {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    overflow: hidden;
    padding-bottom: 0;
}

.tfp-share-poster--compact .tfp-share-round-column {
    min-width: 0;
    flex: 1 1 auto;
}

.tfp-share-poster--compact .tfp-share-round-heading {
    min-height: 24px;
    padding: 0 8px;
    font-size: 10px;
    margin-bottom: 6px;
    width: 100%;
    justify-content: center;
}

.tfp-share-poster--compact .tfp-share-round-stack {
    gap: 5px;
}

.tfp-share-poster--compact .tfp-share-match-card {
    border-radius: 11px;
    padding: 6px;
    box-shadow: 0 8px 16px rgba(16, 33, 87, .07);
}

.tfp-share-poster--compact .tfp-share-match-top {
    margin-bottom: 4px;
    font-size: 7px;
    gap: 4px;
}

.tfp-share-poster--compact .tfp-share-match-top strong {
    font-size: 7px;
}

.tfp-share-poster--compact .tfp-share-team-row {
    gap: 4px;
    border-radius: 8px;
    padding: 4px 5px;
}

.tfp-share-poster--compact .tfp-share-team-row + .tfp-share-team-row {
    margin-top: 3px;
}

.tfp-share-poster--compact .tfp-share-team-names {
    gap: 0;
}

.tfp-share-poster--compact .tfp-share-team-names span {
    font-size: 8px;
    line-height: 1.05;
    white-space: nowrap;
}

.tfp-share-poster--compact .tfp-share-team-row em {
    min-width: 17px;
    height: 17px;
    font-size: 9px;
}

.tfp-share-poster--compact .tfp-share-footer {
    margin-top: 0;
    padding-top: 8px;
    gap: 8px;
}

.tfp-share-poster--compact .tfp-share-footer__logo {
    height: 24px;
}

.tfp-share-poster--compact .tfp-share-footer__brand {
    gap: 8px;
}

.tfp-share-poster--compact .tfp-share-footer__brand strong {
    font-size: 13px;
}

.tfp-share-poster--compact .tfp-share-footer__brand span,
.tfp-share-poster--compact .tfp-share-footer__meta {
    font-size: 9px;
}

/* Na telefonie pokazujemy kartę w całości, bez wielkiej pionowej strony. */
@media (max-width: 640px) {
    .tfp-share-page {
        padding: 10px 8px 18px;
    }

    .tfp-share-topbar {
        gap: 7px;
        margin-bottom: 10px;
    }

    .tfp-share-back,
    .tfp-share-btn {
        min-height: 38px;
        padding: 0 10px;
        font-size: 12px;
    }

    .tfp-share-actions {
        gap: 7px;
    }

    .tfp-share-poster--compact {
        width: min(100%, 360px);
        padding: 11px !important;
        border-radius: 22px !important;
        gap: 7px;
    }

    .tfp-share-poster--compact .tfp-share-brand__logo {
        height: 24px !important;
        max-width: 128px;
    }

    .tfp-share-poster--compact .tfp-share-status-badge {
        display: none;
    }

    .tfp-share-poster--compact .tfp-share-hero h1 {
        font-size: 28px !important;
    }

    .tfp-share-poster--compact .tfp-share-eyebrow {
        font-size: 9px;
    }

    .tfp-share-poster--compact .tfp-share-winner-card {
        grid-template-columns: 72px minmax(0, 1fr);
        padding: 8px !important;
        gap: 8px;
        border-radius: 17px !important;
    }

    .tfp-share-poster--compact .tfp-share-trophy-box {
        height: 92px;
        border-radius: 14px;
    }

    .tfp-share-poster--compact .tfp-share-trophy {
        font-size: 34px;
    }

    .tfp-share-poster--compact .tfp-share-trophy-box span {
        font-size: 8px;
    }

    .tfp-share-poster--compact .tfp-share-winner-chip {
        padding: 4px 8px;
        font-size: 9px;
    }

    .tfp-share-poster--compact .tfp-share-winner-lines strong {
        font-size: 22px !important;
    }

    .tfp-share-poster--compact .tfp-share-score-pill,
    .tfp-share-poster--compact .tfp-share-finalist-pill {
        min-height: 24px;
        font-size: 8.5px;
        padding: 0 7px;
    }

    .tfp-share-poster--compact .tfp-share-round-tab {
        min-height: 24px;
        font-size: 8.5px;
        padding: 0 8px;
    }

    .tfp-share-poster--compact .tfp-share-bracket-wrap {
        padding: 7px;
        border-radius: 15px;
    }

    .tfp-share-poster--compact .tfp-share-bracket-grid {
        gap: 5px;
    }

    .tfp-share-poster--compact .tfp-share-round-heading {
        min-height: 20px;
        padding: 0 5px;
        font-size: 8.5px;
        margin-bottom: 5px;
    }

    .tfp-share-poster--compact .tfp-share-round-stack {
        gap: 4px;
    }

    .tfp-share-poster--compact .tfp-share-match-card {
        padding: 4px;
        border-radius: 9px;
    }

    .tfp-share-poster--compact .tfp-share-match-top,
    .tfp-share-poster--compact .tfp-share-match-top strong {
        font-size: 6px;
    }

    .tfp-share-poster--compact .tfp-share-team-row {
        padding: 3px 4px;
        border-radius: 7px;
    }

    .tfp-share-poster--compact .tfp-share-team-names span {
        font-size: 6.8px;
    }

    .tfp-share-poster--compact .tfp-share-team-row em {
        min-width: 14px;
        height: 14px;
        font-size: 7px;
    }

    .tfp-share-poster--compact .tfp-share-footer {
        padding-top: 6px;
    }

    .tfp-share-poster--compact .tfp-share-footer__logo {
        height: 18px;
    }

    .tfp-share-poster--compact .tfp-share-footer__brand strong {
        font-size: 10px;
    }

    .tfp-share-poster--compact .tfp-share-footer__brand span,
    .tfp-share-poster--compact .tfp-share-footer__meta {
        font-size: 7.5px;
    }
}


/* === TFP: kompakt v2 — większy podgląd bez ucinania mini drabinki === */
.tfp-share-poster--compact {
    width: min(100%, 580px) !important;
    aspect-ratio: 4 / 5.12 !important;
}

.tfp-share-poster--compact .tfp-share-bracket-wrap {
    overflow: visible !important;
}

.tfp-share-poster--compact .tfp-share-bracket-grid {
    overflow: visible !important;
}

@media (max-width: 640px) {
    .tfp-share-page {
        padding: 8px 6px 16px !important;
    }

    .tfp-share-topbar {
        max-width: 418px !important;
    }

    .tfp-share-poster--compact {
        width: min(100%, 414px) !important;
        padding: 12px !important;
        aspect-ratio: 4 / 5.18 !important;
        gap: 8px !important;
    }

    .tfp-share-poster--compact .tfp-share-hero h1 {
        font-size: 31px !important;
    }

    .tfp-share-poster--compact .tfp-share-winner-card {
        grid-template-columns: 78px minmax(0, 1fr) !important;
        padding: 9px !important;
        gap: 9px !important;
    }

    .tfp-share-poster--compact .tfp-share-trophy-box {
        height: 104px !important;
    }

    .tfp-share-poster--compact .tfp-share-winner-lines strong {
        font-size: 25px !important;
    }

    .tfp-share-poster--compact .tfp-share-score-pill,
    .tfp-share-poster--compact .tfp-share-finalist-pill {
        font-size: 9.5px !important;
    }

    .tfp-share-poster--compact .tfp-share-bracket-wrap {
        padding: 8px !important;
        min-height: 220px !important;
    }

    .tfp-share-poster--compact .tfp-share-bracket-grid {
        gap: 6px !important;
    }

    .tfp-share-poster--compact .tfp-share-round-heading {
        font-size: 9px !important;
        min-height: 22px !important;
        margin-bottom: 5px !important;
    }

    .tfp-share-poster--compact .tfp-share-match-card {
        padding: 4px !important;
    }

    .tfp-share-poster--compact .tfp-share-team-names span {
        font-size: 7.3px !important;
    }

    .tfp-share-poster--compact .tfp-share-team-row {
        padding: 3px 4px !important;
    }

    .tfp-share-poster--compact .tfp-share-team-row em {
        min-width: 15px !important;
        height: 15px !important;
        font-size: 7.5px !important;
    }
}

@media (max-width: 390px) {
    .tfp-share-poster--compact {
        width: min(100%, 380px) !important;
        aspect-ratio: 4 / 5.28 !important;
    }

    .tfp-share-poster--compact .tfp-share-hero h1 {
        font-size: 28px !important;
    }

    .tfp-share-poster--compact .tfp-share-winner-lines strong {
        font-size: 22px !important;
    }

    .tfp-share-poster--compact .tfp-share-bracket-wrap {
        min-height: 210px !important;
    }
}


/* === TFP: kompakt v3 — wszystkie ćwierćfinały mieszczą się w grafice === */
.tfp-share-poster--compact {
    aspect-ratio: auto !important;
    min-height: 720px !important;
    height: auto !important;
    overflow: visible !important;
}

.tfp-share-poster--compact .tfp-share-bracket-wrap {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
}

.tfp-share-poster--compact .tfp-share-bracket-grid {
    height: auto !important;
    overflow: visible !important;
    align-items: flex-start !important;
}

.tfp-share-poster--compact .tfp-share-round-stack {
    overflow: visible !important;
}

.tfp-share-poster--compact .tfp-share-footer {
    margin-top: 10px !important;
    position: relative !important;
    z-index: 2 !important;
}

@media (max-width: 640px) {
    .tfp-share-poster--compact {
        width: min(100%, 414px) !important;
        min-height: 640px !important;
        padding: 12px !important;
        gap: 7px !important;
    }

    .tfp-share-poster--compact .tfp-share-brand-row {
        margin-bottom: 0 !important;
    }

    .tfp-share-poster--compact .tfp-share-hero h1 {
        font-size: 29px !important;
    }

    .tfp-share-poster--compact .tfp-share-winner-card {
        margin-top: 2px !important;
        grid-template-columns: 70px minmax(0, 1fr) !important;
        padding: 8px !important;
    }

    .tfp-share-poster--compact .tfp-share-trophy-box {
        height: 90px !important;
    }

    .tfp-share-poster--compact .tfp-share-trophy {
        font-size: 31px !important;
    }

    .tfp-share-poster--compact .tfp-share-winner-lines strong {
        font-size: 22px !important;
    }

    .tfp-share-poster--compact .tfp-share-score-row {
        margin-top: 6px !important;
        gap: 5px !important;
    }

    .tfp-share-poster--compact .tfp-share-score-pill,
    .tfp-share-poster--compact .tfp-share-finalist-pill {
        min-height: 22px !important;
        font-size: 8px !important;
        padding: 0 6px !important;
    }

    .tfp-share-poster--compact .tfp-share-round-tabs {
        display: none !important;
    }

    .tfp-share-poster--compact .tfp-share-bracket-wrap {
        padding: 7px !important;
    }

    .tfp-share-poster--compact .tfp-share-bracket-grid {
        display: grid !important;
        grid-template-columns: 1.28fr 1fr .88fr !important;
        gap: 5px !important;
    }

    .tfp-share-poster--compact .tfp-share-round-heading {
        min-height: 20px !important;
        margin-bottom: 4px !important;
        font-size: 8px !important;
    }

    .tfp-share-poster--compact .tfp-share-round-stack {
        gap: 3px !important;
    }

    .tfp-share-poster--compact .tfp-share-match-card {
        padding: 4px !important;
        border-radius: 8px !important;
        box-shadow: 0 6px 12px rgba(16, 33, 87, .06) !important;
    }

    .tfp-share-poster--compact .tfp-share-match-top {
        margin-bottom: 2px !important;
        font-size: 5.6px !important;
    }

    .tfp-share-poster--compact .tfp-share-match-top strong {
        font-size: 5.6px !important;
    }

    .tfp-share-poster--compact .tfp-share-team-row {
        padding: 2.5px 3px !important;
        border-radius: 6px !important;
    }

    .tfp-share-poster--compact .tfp-share-team-row + .tfp-share-team-row {
        margin-top: 2px !important;
    }

    .tfp-share-poster--compact .tfp-share-team-names span {
        font-size: 6.1px !important;
        line-height: 1.02 !important;
    }

    .tfp-share-poster--compact .tfp-share-team-row em {
        min-width: 13px !important;
        height: 13px !important;
        font-size: 6.5px !important;
    }

    .tfp-share-poster--compact .tfp-share-footer {
        margin-top: 8px !important;
        padding-top: 7px !important;
    }
}

@media (max-width: 390px) {
    .tfp-share-poster--compact {
        min-height: 620px !important;
    }

    .tfp-share-poster--compact .tfp-share-hero h1 {
        font-size: 27px !important;
    }

    .tfp-share-poster--compact .tfp-share-bracket-grid {
        grid-template-columns: 1.32fr 1fr .9fr !important;
        gap: 4px !important;
    }

    .tfp-share-poster--compact .tfp-share-team-names span {
        font-size: 5.8px !important;
    }
}


/* SAFE PATCH — kompaktowe podsumowanie turnieju grupowego, dopisane do istniejącego tournament-share-summary.css */
body.tfp-compact-final-page {
    margin: 0;
    min-height: 100vh;
    padding: 20px 12px 42px;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0b1834;
    background:
        radial-gradient(circle at 50% 0%, rgba(42, 119, 255, .10), transparent 32%),
        linear-gradient(180deg, #f6f9ff 0%, #edf4ff 100%);
}

body.tfp-compact-final-page * {
    box-sizing: border-box;
}

.tfp-final-actions {
    width: min(860px, 100%);
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
}

.tfp-action-back,
.tfp-action-btn {
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    color: #10214a;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(10, 31, 75, .08);
    text-decoration: none;
    font: 900 13px/1 Inter, system-ui, sans-serif;
    cursor: pointer;
}

.tfp-action-btn--primary {
    color: #ffffff;
    background: linear-gradient(135deg, #256eff, #13b7ef);
}

.tfp-final-card {
    width: min(860px, 100%);
    margin: 0 auto;
    padding: 30px 34px 24px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 15% 4%, rgba(37, 110, 255, .08), transparent 25%),
        radial-gradient(circle at 85% 8%, rgba(14, 165, 233, .08), transparent 27%),
        #ffffff;
    border: 1px solid #d7e4fb;
    box-shadow: 0 24px 70px rgba(12, 39, 86, .13);
}

.tfp-final-head {
    position: relative;
    text-align: center;
    padding-bottom: 10px;
}

.tfp-final-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #1161e8;
    font-size: 22px;
    font-weight: 900;
}

.tfp-final-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.tfp-final-status {
    position: absolute;
    top: 6px;
    right: 0;
    padding: 9px 14px;
    border-radius: 999px;
    color: #1350c7;
    background: #edf4ff;
    font-size: 13px;
    font-weight: 900;
}

.tfp-final-title-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
}

.tfp-final-tournament-logo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #d7e4fb;
    background: #f5f9ff;
    flex: 0 0 auto;
}

.tfp-final-tournament-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tfp-final-title-wrap p {
    margin: 0 0 6px;
    color: #2563d9;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.tfp-final-title-wrap h1 {
    margin: 0;
    color: #0b1834;
    font-size: clamp(42px, 7vw, 64px);
    line-height: .95;
    letter-spacing: -.065em;
}

.tfp-final-date {
    display: inline-flex;
    margin-top: 14px;
    padding: 9px 18px;
    border-radius: 999px;
    color: #0d2148;
    background: #ffffff;
    border: 1px solid #d7e4fb;
    box-shadow: 0 10px 22px rgba(12, 39, 86, .06);
    font-weight: 800;
}

.tfp-podium {
    margin-top: 24px;
    display: grid;
    grid-template-columns: .8fr 1.1fr .8fr;
    align-items: end;
    gap: 20px;
}

.tfp-place-card {
    min-width: 0;
    border-radius: 26px;
    background: #ffffff;
    border: 1px solid #d9e5f9;
    box-shadow: 0 16px 38px rgba(12, 39, 86, .08);
    text-align: center;
}

.tfp-place-card--side {
    padding: 26px 18px;
    min-height: 190px;
    display: grid;
    align-content: center;
}

.tfp-place-card--winner {
    padding: 20px 18px 22px;
    border-color: rgba(37, 110, 255, .42);
    box-shadow: 0 20px 46px rgba(37, 110, 255, .13);
}

.tfp-place-card b {
    display: inline-flex;
    justify-self: center;
    margin-bottom: 14px;
    padding: 9px 24px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #256eff, #13b7ef);
    font-size: 20px;
}

.tfp-place-card i {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #0d2148;
    background: linear-gradient(135deg, #d7dee9, #f5f7fb);
    font-style: normal;
    font-size: 30px;
    font-weight: 900;
}

.tfp-place-card--bronze i {
    color: #ffffff;
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.tfp-place-card span {
    display: block;
    color: #687a9d;
    font-size: 15px;
    font-weight: 800;
}

.tfp-place-card strong {
    display: block;
    margin-top: 8px;
    color: #071631;
    font-size: 44px;
    line-height: 1;
    letter-spacing: -.055em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tfp-place-card--winner strong {
    margin-top: 10px;
    font-size: 52px;
}

.tfp-trophy {
    width: 132px;
    height: 132px;
    margin: 0 auto 10px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #edf5ff, #ffffff);
    font-size: 76px;
}

.tfp-place-card small {
    display: inline-flex;
    margin: 13px 3px 0;
    padding: 7px 10px;
    border-radius: 999px;
    color: #1554d1;
    background: #eef5ff;
    font-size: 12px;
    font-weight: 900;
}

.tfp-final-standings {
    margin-top: 26px;
    border-top: 1px solid #dce8fb;
    padding-top: 20px;
}

.tfp-standings-label {
    margin-bottom: 12px;
}

.tfp-standings-label span {
    color: #315fb8;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.tfp-groups-compact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.tfp-group-compact {
    padding: 16px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #dbe7fb;
    box-shadow: 0 12px 30px rgba(12, 39, 86, .07);
}

.tfp-group-compact header {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tfp-group-compact header strong {
    color: #0c1c3d;
    font-size: 22px;
    letter-spacing: -.04em;
}

.tfp-group-compact header span {
    padding: 7px 11px;
    border-radius: 999px;
    color: #1850c7;
    background: #eef5ff;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.tfp-group-compact table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e7eefb;
}

.tfp-group-compact th {
    padding: 10px 8px;
    color: #63769c;
    background: #f6f9ff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: left;
}

.tfp-group-compact td {
    padding: 10px 8px;
    border-top: 1px solid #edf2fb;
    color: #0c1c3d;
    font-size: 15px;
    font-weight: 800;
}

.tfp-group-compact td i {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: #5f6c83;
    background: #edf1f7;
    font-style: normal;
    font-size: 13px;
    font-weight: 900;
}

.tfp-group-compact td i.is-gold {
    color: #fff;
    background: #256eff;
}

.tfp-group-compact td i.is-silver {
    color: #0c1c3d;
    background: #d7dee9;
}

.tfp-group-compact td i.is-bronze {
    color: #fff;
    background: #f08a0b;
}

.tfp-player-name {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tfp-player-points {
    color: #1455d8 !important;
    font-size: 17px !important;
    font-weight: 900 !important;
}

.tfp-final-footer {
    margin-top: 24px;
    padding: 16px 14px;
    border-radius: 18px;
    border: 1px solid #dbe7fb;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    color: #315fb8;
    background: #fbfdff;
    font-weight: 800;
}

.tfp-final-footer div {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #1761e8;
    font-weight: 900;
}

.tfp-final-footer img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.tfp-final-footer span {
    text-align: center;
}

.tfp-final-footer time {
    text-align: right;
    font-weight: 900;
}

@media (max-width: 820px) {
    body.tfp-compact-final-page {
        padding: 12px 8px 28px;
    }

    .tfp-final-card {
        padding: 18px 14px;
        border-radius: 26px;
    }

    .tfp-final-status {
        position: static;
        display: inline-flex;
        margin-top: 12px;
    }

    .tfp-final-title-wrap {
        margin-top: 16px;
        align-items: center;
    }

    .tfp-podium {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tfp-place-card--side,
    .tfp-place-card--winner {
        min-height: 0;
        padding: 16px;
    }

    .tfp-trophy {
        width: 88px;
        height: 88px;
        font-size: 54px;
    }

    .tfp-place-card strong,
    .tfp-place-card--winner strong {
        font-size: 34px;
    }

    .tfp-groups-compact-grid {
        grid-template-columns: 1fr;
    }

    .tfp-group-compact th:nth-child(4),
    .tfp-group-compact td:nth-child(4) {
        display: none;
    }

    .tfp-final-footer {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .tfp-final-footer div,
    .tfp-final-footer time {
        justify-content: center;
        text-align: center;
    }
}
