/* =============================================================================
   STATYSTYKI — Centrum Statystyk KS Perła Węgrów
   =============================================================================
   Design system spójny z podstroną zawodnik.php (.pp namespace):
   - Kolory klubowe: navy #1a2332, gold #AE802F → #FFEFA7, blue #1E3A8A
   - Font Montserrat (globalnie w style.css)
   - Section heads z kicker-pill + accent gradient (jak .pp-section-head)
   - FIFA-style karty (left border gold, big numbers, ikony jako watermark)
   - Semantic colors: win #10b981, draw #f59e0b, loss #ef4444
   - Medal colors: gold #AE802F, silver #B4BCCA, bronze #CE9463
   ============================================================================= */

.stats-hub {
    padding: 0;
    background: #ffffff;
    font-family: 'Montserrat', 'Arial', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.stats-hub .stats-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Empty state — gdy brak danych, dajemy mu własny oddech */
.stats-hub .stats-wrap > .stats-empty {
    margin: 60px auto 90px;
}

/* Tokens — identyczne z .pp z player-profile.css */
.stats-hub {
    --navy: #1a2332;
    --navy-deep: #0a1421;
    --navy-mid: #11192a;
    --navy-2: #24344d;
    --blue: #1E3A8A;
    --gold: #AE802F;
    --gold-light: #FFEFA7;
    --gold-dark: #AE802F;
    --bg-light: #f5f7fa;
    --surface: #ffffff;
    --surface-muted: #fafbfc;
    --border: #e5e7eb;
    --text: #1a2332;
    --text-strong: #1a2332;
    --text-muted: #6b7280;
    --text-faint: #9ca3af;
    --win: #10b981;
    --win-bg: #d1fae5;
    --draw: #f59e0b;
    --draw-bg: #fef3c7;
    --loss: #ef4444;
    --loss-bg: #fee2e2;
    --silver: #B4BCCA;
    --bronze: #CE9463;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 14px;
    --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 8px 28px rgba(16, 24, 40, 0.10);
    --shadow-lg: 0 18px 46px rgba(16, 24, 40, 0.18);
    --gold-glow: 0 6px 22px rgba(174, 128, 47, 0.30);
}

/* Złoty gradient dla akcentów w nagłówkach — identyczny z .pp .pp-accent */
.stats-hub .stats-panel__accent {
    background: linear-gradient(
        110deg,
        #AE802F 0%,
        #FFEFA7 15%,
        #AE802F 30%,
        #AE802F 42%,
        #fffdf0 48%,
        #fff 50%,
        #fffdf0 52%,
        #AE802F 58%,
        #AE802F 70%,
        #FFEFA7 85%,
        #AE802F 100%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: statsGoldSweep 10s ease-in-out infinite;
}

@keyframes statsGoldSweep {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* =============================================================================
   SECTION HEADER — kicker pill + accent title (spójne z .pp-section-head)
   ============================================================================= */
.stats-panel {
    position: relative;
    margin: 0;
    padding: 70px 0;
    /* Sztuczka pełnoszerokiego tła — box-shadow rozlewa się poza .stats-wrap,
       a clip-path tnie tylko poziomo, więc tooltipy wykresów pozostają widoczne. */
    clip-path: inset(0 -100vmax);
}

/* Naprzemienne tła sekcji — wzorzec identyczny jak w zawodnik.php (.pp-*) */
.stats-panel:nth-of-type(odd) {
    background: #ffffff;
    box-shadow: 0 0 0 100vmax #ffffff;
}

.stats-panel:nth-of-type(even) {
    background: #f5f7fa;
    box-shadow: 0 0 0 100vmax #f5f7fa;
}

.stats-panel:first-of-type {
    padding-top: 60px;
}

.stats-panel:last-of-type {
    padding-bottom: 90px;
    margin-bottom: 0;
}

.stats-panel__head {
    text-align: left;
    margin-bottom: 40px;
}

.stats-panel__kicker {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--gold);
    padding: 6px 12px;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: rgba(174, 128, 47, 0.08);
    margin-bottom: 14px;
}

.stats-panel__title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(26px, 3.2vw, 38px);
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.1;
    color: var(--blue);
    margin: 0 0 14px;
}

.stats-panel__subtitle {
    color: var(--text-muted);
    font-size: 0.96rem;
    max-width: 620px;
    margin: 0;
    line-height: 1.55;
}

/* =============================================================================
   HERO DASHBOARD — bento grid z kluczowymi KPI (FIFA-style)
   ============================================================================= */
.dashboard-hero {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 18px;
}

.kpi-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px 22px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--gold);
    overflow: hidden;
    transition: transform 220ms ease, box-shadow 220ms ease, border-left-width 220ms ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    min-height: 140px;
}

.kpi-card:hover,
.kpi-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-left-width: 6px;
}

.kpi-card__label {
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card__value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 2.6rem;
    color: var(--text-strong);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.kpi-card__sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.kpi-card__icon {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 3.4rem;
    color: var(--navy);
    opacity: 0.06;
    pointer-events: none;
    line-height: 1;
}

/* Bento rozmieszczenie — pierwszy rząd 4 kompaktowe, drugi 3 szerokie */
.kpi-card--position    { grid-column: span 3; }
.kpi-card--matches     { grid-column: span 3; }
.kpi-card--points      { grid-column: span 3; }
.kpi-card--balance     { grid-column: span 3; }
.kpi-card--scored      { grid-column: span 4; }
.kpi-card--conceded    { grid-column: span 4; }
.kpi-card--form        { grid-column: span 4; }

/* Pozycja — dramatyczna karta w navy z gold akcentem */
.kpi-card--position {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy-deep) 100%);
    color: #fff;
    border-left-color: var(--gold-light);
    overflow: hidden;
}
.kpi-card--position::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(174, 128, 47, 0.18) 0%, transparent 55%);
    pointer-events: none;
}
.kpi-card--position .kpi-card__label { color: rgba(255, 255, 255, 0.65); }
.kpi-card--position .kpi-card__value {
    background: linear-gradient(135deg, #AE802F, #FFEFA7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 4rem;
    letter-spacing: -3px;
}
.kpi-card--position .kpi-card__sub { color: rgba(255, 255, 255, 0.55); }
.kpi-card--position .kpi-card__icon { color: var(--gold-light); opacity: 0.10; }

/* Bilans bramkowy — kolory semantyczne */
.kpi-card__value--plus  { color: var(--win); }
.kpi-card__value--minus { color: var(--loss); }

.kpi-card--balance .kpi-card__value--plus  { color: var(--win); }
.kpi-card--balance .kpi-card__value--minus { color: var(--loss); }

/* Forma — pastylki W/R/P z ostatnich 5 meczów */
.form-pills {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    margin-top: 6px;
}

.form-pill {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
    cursor: help;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 180ms ease;
}

.form-pill:hover { transform: translateY(-2px); }

.form-pill--W { background: var(--win); }
.form-pill--R { background: var(--draw); color: #1a1206; }
.form-pill--P { background: var(--loss); }
.form-pill--empty {
    background: var(--bg-light);
    color: var(--text-faint);
    box-shadow: none;
    border: 1px dashed var(--border);
}

/* =============================================================================
   PORÓWNANIA LIGOWE — bramki strzelone/stracone (poziome bary)
   ============================================================================= */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.compare-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 28px 26px 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    transition: box-shadow 220ms ease, transform 220ms ease;
}

.compare-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.compare-card__title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--navy);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.compare-card__title i {
    color: var(--gold);
    font-size: 1.05rem;
}

.compare-card__desc {
    color: var(--text-muted);
    font-size: 0.84rem;
    margin: 0 0 22px;
    letter-spacing: 0.2px;
}

/* Lista drużyn — proste poziome bary */
.league-bars {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.league-bar {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 50px;
    align-items: center;
    gap: 14px;
}

.league-bar__logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.league-bar__track {
    position: relative;
    background: #eef0f3;
    border-radius: 8px;
    height: 28px;
    overflow: hidden;
}

.league-bar__fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: linear-gradient(90deg, #cbcfd6, #9aa1ad);
    border-radius: 8px;
    transform: translateX(-100%);
    animation: barGrow 1.1s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.league-bar__name {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 24px);
    letter-spacing: 0.2px;
}

.league-bar__value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-strong);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Highlight Perła — gold sweep */
.league-bar--perla .league-bar__fill {
    background: linear-gradient(90deg, var(--gold-dark) 0%, #d4a04a 50%, var(--gold-light) 100%);
    box-shadow: 0 0 0 1.5px rgba(174, 128, 47, 0.35), 0 4px 12px rgba(174, 128, 47, 0.25);
}

.league-bar--perla .league-bar__name {
    color: var(--navy);
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.league-bar--perla .league-bar__value {
    color: var(--gold-dark);
    font-weight: 900;
}

@keyframes barGrow {
    to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .league-bar__fill { animation: none; transform: translateX(0); }
}

/* =============================================================================
   TABELA LIGOWA — kompaktowa, highlighted Perła
   ============================================================================= */
.stats-league-wrap {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.stats-league-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.stats-league-table thead {
    background: var(--navy);
    color: #fff;
}

.stats-league-table th {
    padding: 16px 10px;
    text-align: center;
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    font-weight: 700;
    color: #fff;
}

.stats-league-table th.lt-team {
    text-align: left;
    padding-left: 20px;
}

.stats-league-table td {
    padding: 14px 10px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text);
}

.stats-league-table tbody tr {
    transition: background 150ms ease;
}

.stats-league-table tbody tr:nth-child(even) {
    background: var(--surface-muted);
}

.stats-league-table tbody tr:hover {
    background: #f1f5fb;
}

.stats-league-table tr:last-child td {
    border-bottom: none;
}

.stats-league-table .lt-pos {
    font-weight: 800;
    color: var(--text-muted);
    width: 50px;
}

.stats-league-table .lt-team {
    text-align: left;
    padding-left: 20px;
}

.stats-league-table .lt-team-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-league-table .lt-team-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.stats-league-table .lt-team-name {
    font-weight: 600;
    color: var(--text-strong);
    text-transform: uppercase;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
}

.stats-league-table .lt-pts {
    font-weight: 900;
    color: var(--text-strong);
    background: var(--bg-light);
    font-size: 1.05rem;
}

.stats-league-table .lt-goals {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

/* Highlight Perły — złoty sweep tła + accent */
.stats-league-table tr.lt-perla {
    background: linear-gradient(90deg, rgba(174, 128, 47, 0.10), rgba(174, 128, 47, 0.04));
    position: relative;
}

.stats-league-table tr.lt-perla:hover {
    background: linear-gradient(90deg, rgba(174, 128, 47, 0.16), rgba(174, 128, 47, 0.06));
}

.stats-league-table tr.lt-perla td {
    font-weight: 700;
}

.stats-league-table tr.lt-perla td:first-child {
    box-shadow: inset 3px 0 0 0 var(--gold);
}

.stats-league-table tr.lt-perla .lt-team-name {
    color: var(--navy);
    font-weight: 800;
}

.stats-league-table tr.lt-perla .lt-pts {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
    color: #1a1206;
    font-weight: 900;
}

/* =============================================================================
   DOM vs WYJAZD — split view
   ============================================================================= */
.home-away {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.venue-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 28px 26px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    overflow: hidden;
    transition: box-shadow 220ms ease, transform 220ms ease;
}

.venue-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Reset – chroni przed globalnym `header { background, color, padding, position: sticky }`
   ze style.css:104, gdyby kiedyś tag <header> trafił z powrotem do markupu. */
.stats-hub .venue-card header,
.stats-hub .compare-card header,
.stats-hub .ranking-card header,
.stats-hub .record-card header,
.stats-hub .donut-card header,
.stats-hub .kpi-card header {
    background: transparent;
    color: inherit;
    padding: 0;
    position: static;
    box-shadow: none;
    top: auto;
    z-index: auto;
}

.venue-card__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: inherit;
}

.venue-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy), var(--navy-mid));
    color: var(--gold-light);
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.25);
}

.venue-card__title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    margin: 0;
    color: var(--navy);
    letter-spacing: -0.2px;
}

.venue-card__subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 3px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Wariantowe akcenty home/away — kolor górnego paska */
.venue-card--home  { border-top-color: var(--gold); }
.venue-card--away  { border-top-color: var(--blue); }

.venue-card--away .venue-card__icon {
    background: linear-gradient(135deg, var(--blue), #11286b);
    color: var(--gold-light);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.30);
}

.venue-card__head {
    align-items: flex-start;
}

.venue-card__head-text {
    flex: 1;
    min-width: 0;
}

/* Badge skuteczności po prawej stronie nagłówka */
.venue-card__effectiveness {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.venue-card__effectiveness-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.venue-card__effectiveness-value small {
    font-size: 0.6em;
    font-weight: 800;
    color: var(--gold);
    margin-left: 2px;
}

.venue-card__effectiveness-label {
    font-size: 9px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

/* Linijka punktów pod nagłówkiem */
.venue-card__points-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(174, 128, 47, 0.08), rgba(174, 128, 47, 0.02));
    border: 1px solid rgba(174, 128, 47, 0.18);
    margin-bottom: 18px;
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 600;
}

.venue-card__points-row i {
    color: var(--gold);
    font-size: 1rem;
    flex-shrink: 0;
}

.venue-card__points-row strong {
    color: var(--navy);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

/* Wizualizacja — stacked bar W/R/P */
.venue-bar {
    display: flex;
    width: 100%;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-light);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    margin-bottom: 14px;
}

.venue-bar__empty {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: var(--text-faint);
    font-style: italic;
    letter-spacing: 0.3px;
}

.venue-bar__seg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    transform: translateX(-100%);
    animation: venueBarGrow 1.1s cubic-bezier(0.33, 1, 0.68, 1) forwards;
    transition: filter 200ms ease;
    cursor: help;
    min-width: 0;
    overflow: hidden;
}

.venue-bar__seg:hover {
    filter: brightness(1.08);
}

.venue-bar__seg--W { background: linear-gradient(180deg, #14c890, var(--win)); }
.venue-bar__seg--R { background: linear-gradient(180deg, #fbb240, var(--draw)); color: #1a1206; }
.venue-bar__seg--P { background: linear-gradient(180deg, #f87171, var(--loss)); }

@keyframes venueBarGrow {
    to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .venue-bar__seg { animation: none; transform: translateX(0); }
}

/* Legenda pod stacked bar */
.venue-bar__legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border);
}

.venue-bar__leg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.venue-bar__leg strong {
    color: var(--text-strong);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-left: 2px;
}

.venue-bar__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.venue-bar__leg--W .venue-bar__dot { background: var(--win); }
.venue-bar__leg--R .venue-bar__dot { background: var(--draw); }
.venue-bar__leg--P .venue-bar__dot { background: var(--loss); }

/* Wizualizacja bramek — porównawcze paski (wspólna skala home/away) */
.venue-goals-viz {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.venue-goal-row {
    display: grid;
    grid-template-columns: 26px auto minmax(0, 1fr) 38px;
    align-items: center;
    gap: 12px;
}

.venue-goal-row__icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.venue-goal-row--scored .venue-goal-row__icon {
    background: rgba(16, 185, 129, 0.12);
    color: var(--win);
}

.venue-goal-row--conceded .venue-goal-row__icon {
    background: rgba(239, 68, 68, 0.12);
    color: var(--loss);
}

.venue-goal-row__label {
    font-size: 0.78rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.venue-goal-row__bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: var(--bg-light);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.venue-goal-row__fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 999px;
    transform: translateX(-100%);
    animation: venueBarGrow 1.1s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.venue-goal-row--scored .venue-goal-row__fill {
    background: linear-gradient(90deg, #14c890, var(--win));
}

.venue-goal-row--conceded .venue-goal-row__fill {
    background: linear-gradient(90deg, #f87171, var(--loss));
}

@media (prefers-reduced-motion: reduce) {
    .venue-goal-row__fill { animation: none; transform: translateX(0); }
}

.venue-goal-row__value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
    text-align: right;
    line-height: 1;
}

/* =============================================================================
   DONUT CHART (ApexCharts wrapper)
   ============================================================================= */
.donut-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    text-align: center;
}

.donut-card__title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--navy);
    margin: 0 0 20px;
    letter-spacing: -0.2px;
}

.donut-chart {
    min-height: 280px;
}

/* =============================================================================
   RECORDS — rekordy sezonu (premium navy + gold cards)
   ============================================================================= */
.records-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.record-card {
    position: relative;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 55%, var(--navy-deep) 100%);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 32px 28px;
    overflow: hidden;
    border: 1px solid rgba(174, 128, 47, 0.25);
    box-shadow: var(--shadow-md);
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.record-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Gold accent strip on top */
.record-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--gold-dark) 0%,
        var(--gold-light) 50%,
        var(--gold-dark) 100%);
    background-size: 200% 100%;
    animation: pp-gold-sweep 8s linear infinite;
}

/* Watermark glow */
.record-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 70%;
    height: 180%;
    background: radial-gradient(circle, rgba(174, 128, 47, 0.18) 0%, transparent 60%);
    pointer-events: none;
}

@keyframes pp-gold-sweep {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .record-card::before { animation: none; }
}

.record-card__label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-light);
    font-weight: 700;
    margin-bottom: 14px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 239, 167, 0.3);
    border-radius: 999px;
    background: rgba(174, 128, 47, 0.10);
}

.record-card__label i {
    font-size: 0.85rem;
}

.record-card__score {
    position: relative;
    z-index: 1;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #AE802F 0%, #FFEFA7 50%, #fff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}

.record-card__opponent {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
}

.record-card__opponent img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.record-card__date {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 10px;
    letter-spacing: 0.3px;
}

/* Wariant porażki — czerwone akcenty */
.record-card--loss {
    border-color: rgba(239, 68, 68, 0.25);
}

.record-card--loss::before {
    background: linear-gradient(90deg, #b91c1c 0%, #ef4444 50%, #b91c1c 100%);
    background-size: 200% 100%;
}

.record-card--loss::after {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.18) 0%, transparent 60%);
}

.record-card--loss .record-card__label {
    color: #fecaca;
    border-color: rgba(254, 202, 202, 0.3);
    background: rgba(239, 68, 68, 0.10);
}

.record-card--loss .record-card__score {
    background: linear-gradient(135deg, #fecaca 0%, #fff 50%, #fca5a5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =============================================================================
   PODIUM CARDS — FIFA-style portrait (top strzelcy, minuty, asysty)
   =============================================================================
   Karty w formacie portret 3:4, zdjęcie full body wypełnia kartę,
   gradient overlay u dołu pod tekstem. Ramki medalowe (gold/silver/bronze). */

.podium-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.podium-card {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(160deg, #202d44 0%, #0e1623 100%);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
    isolation: isolate;
    transition: transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1.2),
                box-shadow 320ms ease;
    border: 2px solid transparent;
    display: block;
}

.podium-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* Zdjęcia — _full.png domyślnie, .png (popiersie) na hover */
.podium-card__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: saturate(1.05);
    transition: opacity 380ms ease, transform 600ms ease;
    backface-visibility: hidden;
}

/* Sylwetka full body — głowa wysoko, by nie nachodzić na medal */
.podium-card__photo--full {
    object-position: center top;
    opacity: 1;
}

/* Popiersie — większy zoom na twarz, pojawia się na hover */
.podium-card__photo--bust {
    object-position: center 18%;
    opacity: 0;
    transform: scale(1.04);
    z-index: 0;
}

.podium-card:hover .podium-card__photo--full,
.podium-card:focus-visible .podium-card__photo--full {
    opacity: 0;
    transform: scale(1.05);
}

.podium-card:hover .podium-card__photo--bust,
.podium-card:focus-visible .podium-card__photo--bust {
    opacity: 1;
    transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .podium-card__photo { transition: opacity 200ms ease; transform: none !important; }
}

/* Delikatny, dolny gradient — żeby glass panel miał lekkie tło pod sobą */
.podium-card__photo-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 60%,
        rgba(12, 20, 34, 0.18) 100%
    );
    pointer-events: none;
}

/* Rank — mała pastylka z pozycją, umieszczona zaraz pod #NR zawodnika.
   Remisujący gracze dostają tę samą pozycję (competition ranking, 1224). */
.podium-card__rank {
    position: absolute;
    top: 52px;
    right: 14px;
    z-index: 3;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.72rem;
    line-height: 1;
    letter-spacing: 0.4px;
    color: #fff;
    background: rgba(12, 20, 34, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    min-width: 26px;
    text-align: center;
    pointer-events: none;
    user-select: none;
}

.podium-card__jersey {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.95);
    color: var(--navy);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 999px;
    min-width: 32px;
    text-align: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Glass panel na dole — wzorzec z druzyna.php (.player-card-soft .glass) */
.podium-card__body {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 14px 16px;
    z-index: 3;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.10);
}

.podium-card__name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    margin: 0 0 3px;
    line-height: 1.18;
    color: #0f172a;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.podium-card__position {
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.podium-card__value-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(15, 23, 42, 0.14);
}

.podium-card__value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.85rem;
    line-height: 1;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

.podium-card__value-label {
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #475569;
    font-weight: 700;
}

/* Medal — kolorowa ramka/akcent */
.podium-card--gold {
    border-color: var(--gold);
    box-shadow: 0 14px 35px rgba(174, 128, 47, 0.30), var(--shadow-md);
}

.podium-card--gold .podium-card__rank {
    color: var(--navy);
    background: linear-gradient(135deg, #AE802F, #FFEFA7);
}

.podium-card--gold .podium-card__value {
    color: #8b6620;
}

.podium-card--silver {
    border-color: var(--silver);
}

.podium-card--silver .podium-card__rank {
    color: var(--navy);
    background: linear-gradient(135deg, #ECEEF3 0%, #B4BCCA 60%, #7A8292 100%);
}

.podium-card--silver .podium-card__value {
    color: #4c5664;
}

.podium-card--bronze {
    border-color: var(--bronze);
}

.podium-card--bronze .podium-card__rank {
    color: #fff;
    background: linear-gradient(135deg, #CE9463 0%, #9C6332 55%, #5F3A19 100%);
}

.podium-card--bronze .podium-card__value {
    color: #7a4a22;
}

/* Medal badge (widoczny na top 3) — przesunięty do lewego górnego rogu, by nie kolidował z głową */
.podium-card__medal {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--navy);
    background: linear-gradient(135deg, #AE802F, #FFEFA7);
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 0 0 3px rgba(12, 20, 34, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Rank jest wyśrodkowany w .podium-card__rank — nie nadpisujemy pozycji dla tier-ów */

.podium-card--silver .podium-card__medal {
    background: linear-gradient(135deg, #ECEEF3 0%, #B4BCCA 60%, #7A8292 100%);
    color: var(--navy);
}

.podium-card--bronze .podium-card__medal {
    background: linear-gradient(135deg, #CE9463 0%, #9C6332 55%, #5F3A19 100%);
    color: #fff;
}

/* Shine effect na gold podium */
.podium-card--gold::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        110deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 239, 167, 0.22) 50%,
        transparent 60%,
        transparent 100%
    );
    background-size: 300% 100%;
    animation: podiumShine 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes podiumShine {
    0%, 30% { background-position: 120% center; }
    70%, 100% { background-position: -20% center; }
}

@media (prefers-reduced-motion: reduce) {
    .podium-card--gold::before { animation: none; }
    .podium-card { transition: none; }
}

/* Przypadek bez zdjęcia */
.podium-card--no-photo {
    background: linear-gradient(160deg, #1e2a3d 0%, #0a0f18 100%);
}

.podium-card--no-photo .podium-card__photo {
    opacity: 0.15;
    object-fit: contain;
    padding: 20%;
}

/* =============================================================================
   RANKING LIST — kompaktowa lista (asysty, oceny, kartki)
   ============================================================================= */
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.ranking-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 26px 22px 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    transition: box-shadow 220ms ease, transform 220ms ease;
}

.ranking-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.ranking-card__title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--navy);
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.2px;
}

.ranking-card__title i {
    color: var(--gold);
    font-size: 1.05rem;
}

.ranking-card__meta {
    margin: -10px 0 14px;
    font-size: 0.82rem;
    color: var(--text-faint);
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.ranking-card__meta strong {
    color: var(--navy);
    font-weight: 700;
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 26px 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 8px 8px;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    transition: background 180ms ease, transform 180ms ease;
}

.ranking-item:hover {
    background: var(--bg-light);
    transform: translateX(2px);
}

.ranking-item__rank {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    color: var(--text-faint);
    font-size: 0.95rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Pierwsza pozycja — wyróżnienie złotem */
.ranking-list li:first-child .ranking-item__rank {
    color: var(--gold-dark);
    font-size: 1.1rem;
}

.ranking-list li:nth-child(2) .ranking-item__rank {
    color: #8A94A6;
}

.ranking-list li:nth-child(3) .ranking-item__rank {
    color: var(--bronze);
}

.ranking-item__photo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 22%;
    background: var(--bg-light);
    border: 2px solid var(--border);
    transition: border-color 180ms ease;
}

.ranking-item:hover .ranking-item__photo {
    border-color: var(--gold);
}

.ranking-list li:first-child .ranking-item__photo {
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(174, 128, 47, 0.25);
}

.ranking-item__name {
    font-weight: 600;
    color: var(--text-strong);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

.ranking-item__value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: var(--navy);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--gold-light), #fff8d8);
    padding: 4px 12px;
    border-radius: 999px;
    min-width: 42px;
    text-align: center;
    border: 1px solid rgba(174, 128, 47, 0.25);
}

.ranking-item__value--loss {
    background: var(--loss-bg);
    color: var(--loss);
    border-color: rgba(239, 68, 68, 0.3);
}

.ranking-item__value--draw {
    background: var(--draw-bg);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.3);
}

.ranking-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 22px 0;
    font-style: italic;
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */
.stats-empty {
    text-align: center;
    padding: 70px 30px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.stats-empty i {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 18px;
    display: block;
    opacity: 0.6;
}

.stats-empty h2 {
    color: var(--navy);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    margin: 0 0 10px;
    font-size: 1.4rem;
}

/* =============================================================================
   FOCUS STATES — accessibility
   ============================================================================= */
.stats-hub a:focus-visible,
.stats-hub button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Nadpisanie globalnego a:not(.btn):hover z style.css (linia 49)
   Globalna reguła ustawia -webkit-text-fill-color: transparent dla każdego <a>
   na hover, co sprawia, że napisy w kartach-linkach znikają. Resetujemy to
   dla wszystkich linków-kart w stats-hub i ich potomków. */
.stats-hub a,
.stats-hub a:hover,
.stats-hub a:focus,
.stats-hub a *,
.stats-hub a:hover *,
.stats-hub a:focus * {
    -webkit-text-fill-color: currentColor;
}

.stats-hub .podium-card,
.stats-hub .podium-card:hover,
.stats-hub .ranking-item,
.stats-hub .ranking-item:hover {
    background-image: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
}

/* =============================================================================
   RESPONSYWNOŚĆ
   ============================================================================= */

/* Tablet (≤992px) */
@media (max-width: 992px) {
    .stats-panel { padding: 56px 0; }
    .stats-panel:first-of-type { padding-top: 48px; }
    .stats-panel:last-of-type { padding-bottom: 72px; }
    .stats-panel__head { margin-bottom: 32px; }

    /* Hero bento — kompaktujemy do 6 kolumn */
    .dashboard-hero {
        grid-template-columns: repeat(6, 1fr);
        grid-auto-rows: minmax(120px, auto);
        gap: 14px;
    }
    .kpi-card--position  { grid-column: span 6; }
    .kpi-card--matches,
    .kpi-card--points,
    .kpi-card--balance   { grid-column: span 2; }
    .kpi-card--scored,
    .kpi-card--conceded  { grid-column: span 3; }
    .kpi-card--form      { grid-column: span 6; }

    .kpi-card { padding: 20px 18px; }
    .kpi-card__value { font-size: 2.1rem; }
    .kpi-card--position .kpi-card__value { font-size: 3.4rem; }

    .podium-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    /* Top 3 w pierwszym rzędzie, 4+5 w drugim */
    .podium-card:nth-child(1) { grid-column: 2; grid-row: 1; }
    .podium-card:nth-child(2) { grid-column: 1; grid-row: 1; }
    .podium-card:nth-child(3) { grid-column: 3; grid-row: 1; }
    .podium-card:nth-child(4) { grid-column: 1 / span 2; grid-row: 2; aspect-ratio: 16 / 9; }
    .podium-card:nth-child(5) { grid-column: 3; grid-row: 2; aspect-ratio: 3 / 4; }
    /* Karta pełnoszeroka: twarz od góry, żeby nie przycinało głowy */
    .podium-card:nth-child(4) .podium-card__photo--full { object-position: center top; }
    .podium-card:nth-child(4) .podium-card__photo--bust { object-position: center 8%; }

    .ranking-grid {
        grid-template-columns: 1fr 1fr;
    }

    .compare-grid,
    .home-away,
    .records-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stats-league-table {
        font-size: 0.86rem;
    }
    .stats-league-table th,
    .stats-league-table td {
        padding: 12px 8px;
    }
    .stats-league-table .lt-team-logo {
        width: 26px;
        height: 26px;
    }
    .stats-league-table .lt-team-name {
        font-size: 0.82rem;
    }

    .record-card { padding: 28px 22px; }
    .record-card__score { font-size: 2.6rem; }
}

/* Telefon (≤600px) */
@media (max-width: 600px) {
    .stats-hub { padding: 0; }
    .stats-hub .stats-wrap { padding: 0 16px; }

    .stats-panel { padding: 44px 0; }
    .stats-panel:first-of-type { padding-top: 36px; }
    .stats-panel:last-of-type { padding-bottom: 60px; }
    .stats-panel__head { margin-bottom: 26px; }
    .stats-panel__title { font-size: 1.55rem; }
    .stats-panel__subtitle { font-size: 0.88rem; }
    .stats-panel__kicker { font-size: 11px; padding: 5px 12px; }

    /* Hero — 2 kolumny + szerokie spany */
    .dashboard-hero {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .kpi-card--position,
    .kpi-card--form       { grid-column: span 2; }
    .kpi-card--matches,
    .kpi-card--points,
    .kpi-card--balance,
    .kpi-card--scored,
    .kpi-card--conceded   { grid-column: span 1; }

    .kpi-card {
        padding: 18px 16px;
        min-height: 120px;
    }
    .kpi-card__value { font-size: 1.85rem; }
    .kpi-card__icon { font-size: 2.6rem; top: 12px; right: 12px; }
    .kpi-card--position .kpi-card__value { font-size: 3.2rem; }
    .kpi-card__label { font-size: 10px; letter-spacing: 1.4px; }

    .form-pill { width: 32px; height: 32px; font-size: 0.88rem; }

    /* Podium — 2 kolumny, pierwszy szeroki */
    .podium-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .podium-card:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
        aspect-ratio: 3 / 4;
    }
    .podium-card:nth-child(1) {
        grid-column: 1 / -1;
        aspect-ratio: 16 / 10;
    }
    /* Karta pełnoszeroka na mobile: twarz od góry, żeby nie przycinało głowy */
    .podium-card:nth-child(1) .podium-card__photo--full { object-position: center top; }
    .podium-card:nth-child(1) .podium-card__photo--bust { object-position: center 6%; }

    .podium-card__rank { top: 46px; right: 12px; font-size: 0.68rem; padding: 2px 8px; }
    .podium-card__name { font-size: 0.88rem; }
    .podium-card__value { font-size: 1.6rem; }
    .podium-card__body { padding: 14px 12px 12px; }

    /* Tabela ligowa — ukrywamy kolumny auxiliary */
    .stats-league-table th.lt-hide-mobile,
    .stats-league-table td.lt-hide-mobile {
        display: none;
    }
    .stats-league-table th,
    .stats-league-table td {
        padding: 11px 6px;
    }

    .ranking-grid {
        grid-template-columns: 1fr;
    }

    .venue-card { padding: 22px 18px 18px; }
    .venue-card__icon { width: 42px; height: 42px; font-size: 1rem; }
    .venue-card__head { gap: 12px; padding-bottom: 14px; margin-bottom: 16px; }
    .venue-card__title { font-size: 1.05rem; }
    .venue-card__effectiveness { padding-left: 10px; }
    .venue-card__effectiveness-value { font-size: 1.4rem; }
    .venue-card__points-row { padding: 10px 12px; font-size: 0.85rem; margin-bottom: 14px; }
    .venue-bar { height: 32px; }
    .venue-bar__seg { font-size: 0.82rem; }
    .venue-bar__legend { gap: 6px 12px; font-size: 0.74rem; padding-bottom: 12px; margin-bottom: 14px; }
    .venue-goal-row { grid-template-columns: 24px auto minmax(0, 1fr) 34px; gap: 10px; }
    .venue-goal-row__label { font-size: 0.72rem; letter-spacing: 0.5px; }
    .venue-goal-row__value { font-size: 1.05rem; }

    .record-card { padding: 24px 20px; }
    .record-card__score { font-size: 2.2rem; }
    .record-card__opponent { font-size: 0.88rem; gap: 10px; }
    .record-card__opponent img { width: 28px; height: 28px; }

    .ranking-card { padding: 22px 18px 18px; }
    .ranking-item { padding: 8px 4px; gap: 12px; grid-template-columns: 22px 34px minmax(0, 1fr) auto; }
    .ranking-item__photo { width: 34px; height: 34px; }
    .ranking-item__name { font-size: 0.88rem; }

    .compare-card { padding: 22px 18px 16px; }
    .compare-card__title { font-size: 1.05rem; }
    .league-bar { grid-template-columns: 26px minmax(0, 1fr) 42px; gap: 10px; }
    .league-bar__logo { width: 26px; height: 26px; }
    .league-bar__track { height: 24px; }
    .league-bar__name { font-size: 0.74rem; }
}

@media (max-width: 380px) {
    .podium-grid { grid-template-columns: 1fr; }
    .podium-card:nth-child(n) { grid-column: auto; aspect-ratio: 16 / 10; }
    .podium-card__photo--full { object-position: center top; }
    .podium-card__photo--bust { object-position: center 6%; }
}

/* =============================================================
   Overlay avatarów na wykresach (chart-scorers / chart-minutes)
   Pozycjonowane absolutnie w środku kolumn — JS wylicza pozycje
   na podstawie etykiet osi X i aktualizuje je na resize.
   ============================================================= */
.chart-avatar-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.chart-avatar {
    position: absolute;
    transform: translateX(-50%);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 80px;
}

.chart-avatar__frame {
    display: block;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 2px solid #d4af37;
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.18);
    flex-shrink: 0;
}

.chart-avatar__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    display: block;
}

.chart-avatar--team .chart-avatar__frame img {
    object-fit: contain;
    object-position: center center;
    padding: 4px;
}

.chart-avatar__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6a6a6a;
    white-space: nowrap;
    text-align: center;
    line-height: 1.1;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-avatar--team .chart-avatar__label {
    color: #1a2332;
    font-weight: 700;
}

@media (max-width: 600px) {
    .chart-avatar { max-width: 44px; gap: 3px; }
    .chart-avatar__frame { width: 34px; height: 34px; border-width: 2px; }
    .chart-avatar__label { font-size: 0.54rem; max-width: 44px; letter-spacing: -0.02em; }
}

@media (max-width: 420px) {
    .chart-avatar { max-width: 38px; }
    .chart-avatar__frame { width: 30px; height: 30px; }
    .chart-avatar__label { font-size: 0.5rem; max-width: 38px; }
}

/* ==========================================================================
   PRZYCISK "ZOBACZ WSZYSTKICH" + MODAL PEŁNEGO RANKINGU
   ========================================================================== */

.full-ranking-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 22px auto 0;
    padding: 14px 22px;
    border: 1px solid rgba(174, 128, 47, 0.35);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(174, 128, 47, 0.08), rgba(255, 239, 167, 0.04));
    color: #1a2332;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
    box-shadow: 0 2px 6px rgba(26, 35, 50, 0.04);
}

.full-ranking-trigger:hover,
.full-ranking-trigger:focus-visible {
    background: linear-gradient(135deg, rgba(174, 128, 47, 0.16), rgba(255, 239, 167, 0.12));
    border-color: rgba(174, 128, 47, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26, 35, 50, 0.1);
    outline: none;
}

.full-ranking-trigger:active {
    transform: translateY(0);
}

.full-ranking-trigger__arrow {
    font-size: 0.85rem;
    color: #AE802F;
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.full-ranking-trigger:hover .full-ranking-trigger__arrow,
.full-ranking-trigger:focus-visible .full-ranking-trigger__arrow {
    transform: translateY(4px);
}

/* Wariant kompaktowy — wewnątrz .ranking-card (sekcja Pozostałe rankingi) */
.full-ranking-trigger--compact {
    margin-top: 14px;
    padding: 10px 16px;
    font-size: 0.85rem;
    border-radius: 12px;
}

/* Ukryte kontenery ze źródłem danych modala */
.full-ranking-source {
    display: none !important;
}

/* ===== Modal ===== */
.ranking-modal {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.ranking-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.ranking-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 28, 0.86);
}

.ranking-modal__dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: min(85vh, 720px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(10, 16, 28, 0.45), 0 10px 30px rgba(10, 16, 28, 0.3);
    transform: translateY(16px);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ranking-modal.is-open .ranking-modal__dialog {
    transform: translateY(0);
}

.ranking-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #1a2332 0%, #243349 100%);
    color: #fff;
    border-bottom: 2px solid #AE802F;
}

.ranking-modal__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

/* Efekt gold-sweep na tytule modala — identyczny z tytułami sekcji na karcie zawodnika */
.ranking-modal__title #ranking-modal-title-text {
    background: linear-gradient(
        110deg,
        #AE802F 0%,
        #FFEFA7 15%,
        #AE802F 30%,
        #AE802F 42%,
        #fffdf0 48%,
        #fff 50%,
        #fffdf0 52%,
        #AE802F 58%,
        #AE802F 70%,
        #FFEFA7 85%,
        #AE802F 100%
    );
    background-size: 300% 100%;
    background-position: 100% center;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Uruchamiamy animację dopiero gdy modal jest otwarty — inaczej goldSweep
   leci w tle 24/7 i generuje repainty mimo że modal jest niewidoczny. */
.ranking-modal.is-open .ranking-modal__title #ranking-modal-title-text {
    animation: goldSweep 10s ease-in-out infinite;
}

.ranking-modal__title i {
    color: #FFEFA7;
    font-size: 1.05rem;
}

@media (prefers-reduced-motion: reduce) {
    .ranking-modal.is-open .ranking-modal__title #ranking-modal-title-text { animation: none; }
}

.ranking-modal__close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
}

.ranking-modal__close:hover,
.ranking-modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
    outline: none;
}

.ranking-modal__body {
    overflow-y: auto;
    padding: 14px 18px 20px;
    background: #f7f8fb;
    -webkit-overflow-scrolling: touch;
}

/* Elegancki scrollbar */
.ranking-modal__body::-webkit-scrollbar {
    width: 8px;
}
.ranking-modal__body::-webkit-scrollbar-track {
    background: transparent;
}
.ranking-modal__body::-webkit-scrollbar-thumb {
    background: rgba(174, 128, 47, 0.35);
    border-radius: 4px;
}
.ranking-modal__body::-webkit-scrollbar-thumb:hover {
    background: rgba(174, 128, 47, 0.55);
}

/* Lista pełna w modalu — dostosowanie wysokości */
.ranking-modal__body .ranking-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranking-modal__body .ranking-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(26, 35, 50, 0.04);
}

/* Blokada scrolla body gdy modal otwarty */
body.ranking-modal-open {
    overflow: hidden;
}

/* Mobile */
@media (max-width: 600px) {
    .ranking-modal {
        padding: 0;
        align-items: flex-end;
    }

    .ranking-modal__dialog {
        width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
    }

    .ranking-modal.is-open .ranking-modal__dialog {
        transform: translateY(0);
    }

    .ranking-modal__header {
        padding: 16px 18px;
    }

    .ranking-modal__title {
        font-size: 1rem;
    }

    .ranking-modal__body {
        padding: 12px 14px 18px;
    }

    .full-ranking-trigger {
        padding: 12px 18px;
        font-size: 0.88rem;
    }
}
