/* ═══════════════════════════════════════════════════════════════
   Juve Livescores — Theme
═══════════════════════════════════════════════════════════════ */

/* --- Zmienne ------------------------------------------------ */
.juve-livescores-root:not([data-type="spotlight-legacy"]) {
    --juve-bg:        #0d0d0d;
    --juve-surface:   #181818;
    --juve-surface2:  #222222;
    --juve-border:    #2e2e2e;
    --juve-gold:      #F5B800;
    --juve-gold-dim:  rgba(245, 184, 0, 0.12);
    --juve-text:      #f0f0f0;
    --juve-muted:     #888;
    --juve-radius:    10px;
    --juve-font:      'Roboto Condensed', sans-serif; /* display */
    --juve-font-ui:   'Roboto Condensed', sans-serif;
    --juve-green:     #3ecf70;
    --juve-red:       #e05050;
    --juve-draw:      #888;

    font-family: var(--juve-font-ui);
    background:  var(--juve-bg);
    color:       var(--juve-text);
    border-radius: var(--juve-radius);
    overflow: hidden;
    max-width: 740px;
    /* margin: 0 auto; */
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}

.juve-livescores-root:not([data-type="spotlight-legacy"]) {
    margin: 0 0 50px;
}

/* --- Header ------------------------------------------------- */
.jls-header {
    background: var(--juve-surface);
    border-bottom: 1px solid var(--juve-border);
    padding: 20px 24px 0;
}

.jls-header-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.jls-crest {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.jls-title {
    font-family: var(--juve-font);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--juve-text);
    line-height: 1.1;
}

.jls-subtitle {
    font-size: 11px;
    color: var(--juve-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: 2px;
}

.jls-live-badge {
    margin-left: auto;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    display: none;
    align-items: center;
    gap: 5px;
}

.jls-live-badge.visible { display: flex; }

.jls-live-dot {
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: jls-pulse 1.2s ease-in-out infinite;
}

@keyframes jls-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}

/* --- Tabs --------------------------------------------------- */
.jls-tabs {
    display: flex;
    gap: 2px;
}

.jls-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--juve-muted);
    /* font-family: var(--juve-font-ui); */
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 10px 18px 8px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}

.jls-tab:hover       { color: var(--juve-text); }
.jls-tab.active      { color: var(--juve-gold); border-bottom-color: var(--juve-gold); }

/* --- Zawartość paneli --------------------------------------- */
.jls-panel {
    display: none;
    padding: 0;
}

.jls-panel.active { display: block; }

/* --- Mecz (karta w terminrazu) ------------------------------ */
.jls-match {
    display: grid;
    grid-template-columns: 1fr 200px 200px;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--juve-border);
    transition: background .12s;
}

.jls-match:nth-child(even) { background: var(--juve-surface); }

.jls-match:hover { background: var(--juve-surface2); }

.jls-match:last-child { border-bottom: none; }

.jls-match--live {
    background: var(--juve-gold-dim);
}

.jls-match--live:hover { background: rgba(245,184,0,.18); }

.jls-teams {
    display: flex;
    align-items: center;
    gap: 4px;
}

.jls-team {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.jls-team--away {
    flex-direction: row-reverse;
    text-align: right;
}

.jls-team-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.jls-team-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--juve-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.jls-team-name--juve { color: var(--juve-gold) !important; }
.jls-team-name--juve:hover { text-decoration: underline; }

.jls-league-name {
    font-size: 13px;
    color: var(--juve-muted);
    text-align: center;
    /* margin-top: 4px; */
}

.jls-score-box {
    text-align: center;
}

.jls-score {
    font-family: var(--juve-font);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--juve-text);
    line-height: 1;
}

.jls-score--live { color: var(--juve-gold); }

.jls-date {
    text-align: center;
}

.jls-match-info {
    font-size: 10px;
    color: var(--juve-muted);
    letter-spacing: .04em;
    margin-top: 4px;
    text-transform: uppercase;
}

.jls-match-minute {
    color: #c0392b;
    font-weight: 700;
}

/* --- Sekcja ostatni / następny mecz ------------------------ */

.juve-spotlight-root .jls-header {
    display: none;
}
.juve-spotlight-root .jls-panel {
    container-type: inline-size;
}

.jls-spotlight {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--juve-border);
    border-bottom: 1px solid var(--juve-border);
}

.jls-spotlight-card {
    background: var(--juve-surface);
    padding: 10px 5px;
}

.jls-spotlight-label {
    font-size: 12px;
    color: var(--juve-gold);
    letter-spacing: .1em;
    text-transform: uppercase;
    text-align: center;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 5px;
}

.jls-spotlight-date {
    margin: 5px 0 10px;
    text-align: center;
    font-size: 18px;
}

.jls-spotlight-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.jls-spotlight-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.jls-spotlight-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.jls-spotlight-name {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--juve-text);
}

.jls-spotlight-score {
    font-family: var(--juve-font);
    font-size: 28px;
    font-weight: 700;
    color: var(--juve-text);
    padding: 0 12px;
    white-space: nowrap;
}

.jls-spotlight-meta {
    font-size: 14px;
    text-align: center;
    color: var(--juve-muted);
    margin-top: 10px;
}

/* --- Sekcja terminrza --------------------------------------- */
.jls-section-title {
    font-size: 10px;
    color: var(--juve-muted);
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 14px 20px 8px;
    border-bottom: 1px solid var(--juve-border);
}

/* --- Tabela Serie A ----------------------------------------- */
.jls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.jls-table thead th {
    background: var(--juve-surface);
    color: var(--juve-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--juve-border);
}

.jls-table thead th:first-child,
.jls-table thead th:nth-child(2) {
    text-align: left;
    padding-left: 16px;
}

.jls-table tbody tr {
    border-bottom: 1px solid var(--juve-border);
    transition: background .1s;
}

.jls-table tbody tr:hover { background: var(--juve-surface2); }

.jls-table tbody tr:last-child { border-bottom: none; }

.jls-table tbody tr.jls-row--juve {
    background: var(--juve-gold-dim);
}

.jls-table tbody tr.jls-row--juve:hover {
    background: rgba(245,184,0,.18);
}

.jls-table td {
    padding: 10px 8px;
    text-align: center;
    color: var(--juve-text);
}

.jls-table td:first-child {
    text-align: left;
    padding-left: 16px;
    width: 28px;
    color: var(--juve-muted);
    font-size: 12px;
}

.jls-table td:nth-child(2) {
    text-align: left;
    padding-left: 8px;
}

.jls-team-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jls-team-cell img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.jls-points {
    font-weight: 700;
    color: var(--juve-text);
}

.jls-row--juve .jls-points { color: var(--juve-gold); }

.jls-form-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin: 0 1px;
}

.jls-form-dot.W { background: var(--juve-green); }
.jls-form-dot.D { background: var(--juve-draw); }
.jls-form-dot.L { background: var(--juve-red); }

/* Strefy europejskie */
.jls-pos-badge {
    display: inline-block;
    width: 4px;
    height: 16px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

.jls-pos--ucl  { background: #2563eb; }
.jls-pos--uel  { background: #f97316; }
.jls-pos--rel  { background: #e05050; }

/* --- Strzelcy ----------------------------------------------- */

.jls-scorer {
    display: grid;
    grid-template-columns: 28px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--juve-border);
    transition: background .12s;
}

.jls-scorer-header .jls-scorer-info {
    font-size: 18px;
    font-weight: 700;
}

.jls-scorer:hover { background: var(--juve-surface2); }
.jls-scorer:last-child { border-bottom: none; }

.jls-scorer-rank {
    font-size: 18px;
    color: var(--juve-muted);
    text-align: center;
    width: 40px;
}

.jls-scorer-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.jls-scorer-photo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--juve-surface2);
    flex-shrink: 0;
}

.jls-scorer-name-club {
    flex-grow: 1;
    display: flex;
    gap: 0 20px;
}

.jls-scorer-name {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.jls-scorer-club {
    font-size: 18px;
    color: var(--juve-muted);
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
    width: 50%;
}

.jls-scorer-club img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.jls-goals {
    font-family: var(--juve-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--juve-text);
    text-align: right;
    min-width: 28px;
    width: 45px;
}

.jls-assists {
    font-size: 11px;
    color: var(--juve-muted);
    text-align: right;
    white-space: nowrap;
}

.juve-scorers-root[data-view="kompaktowy"] {
    margin: 0 0 30px;
}

.juve-scorers-root[data-view="kompaktowy"] .jls-scorer {
    padding: 10px 12px;
    min-height: 43px;
}

.juve-scorers-root[data-view="kompaktowy"] .jls-scorer-header {
    /* padding: 14px 12px; */
    padding: 5px 12px;
    min-height: unset;
    background: var(--juve-surface);
}

.juve-scorers-root[data-view="kompaktowy"] .jls-scorer-rank {
    font-size: 12px;
    text-align: left;
}

.juve-scorers-root[data-view="kompaktowy"] .jls-scorer-info, .juve-scorers-root[data-view="kompaktowy"] .jls-goals {
    font-size: 15px;
}

.juve-scorers-root[data-view="kompaktowy"] .jls-scorer-name, .juve-scorers-root[data-view="kompaktowy"] .jls-scorer-club {
    font-size: 13px;
    font-weight: 500;
}

.juve-scorers-root[data-view="kompaktowy"] .jls-goals {
    font-size: 14px;
}

/* --- Loader & błąd ------------------------------------------ */
.jls-loader {
    padding: 48px 20px;
    text-align: center;
    color: var(--juve-muted);
    font-size: 13px;
}

.jls-spinner {
    width: 28px; height: 28px;
    border: 2px solid var(--juve-border);
    border-top-color: var(--juve-gold);
    border-radius: 50%;
    animation: jls-spin .8s linear infinite;
    margin: 0 auto 14px;
}

@keyframes jls-spin { to { transform: rotate(360deg); } }

.jls-error {
    padding: 32px 20px;
    text-align: center;
    color: var(--juve-red);
    font-size: 13px;
}

/* --- Footer ------------------------------------------------- */
.jls-footer {
    background: var(--juve-surface);
    border-top: 1px solid var(--juve-border);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jls-updated {
    font-size: 11px;
    color: var(--juve-muted);
}

.jls-refresh-btn {
    background: none;
    border: 1px solid var(--juve-border);
    color: var(--juve-muted);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--juve-font-ui);
    transition: color .15s, border-color .15s;
}

.jls-refresh-btn:hover {
    color: var(--juve-text);
    border-color: var(--juve-muted);
}

/* --- Responsywność ------------------------------------------ */
@media (max-width: 992px) {
    .jls-match {
        grid-template-columns: 1fr;
    }

    .jls-teams {
        justify-content: center;
    }

    .jls-scorer-rank {
        width: 25px;
    }

    .jls-scorer-name-club {
        flex-direction: column;
    }

    .jls-scorer-name, .jls-scorer-club {
        width: 100%;
    }

    .jls-scorer-club img {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 560px) {
    .jls-spotlight { grid-template-columns: 1fr; }
    .jls-team-name { max-width: 90px; }
    .jls-table td:nth-child(n+7):not(:last-child) { display: none; }
    .jls-tab { padding: 10px 12px 8px; font-size: 11px; }
    /* .jls-scorer { grid-template-columns: 24px 1fr auto; } */
    .jls-scorer { grid-template-columns: 24px 1fr auto; }
    .jls-assists { display: none; }
}

@container (width > 520px) {
    .jls-spotlight { grid-template-columns: 1fr 1fr; }
} 

    /* ═══════════════════════════════════════════════════════════
       Serie A Tabela — ciemny styl
    ═══════════════════════════════════════════════════════════ */
    .juve-standings-root {
        --sl-bg:        #0d0d0d;
        --sl-surface:   #181818;
        --sl-surface2:  #222222;
        --sl-border:    #2e2e2e;
        --sl-text:      #f0f0f0;
        --sl-muted:     #888;
        --sl-gold:      #F5B800;
        --sl-gold-dim:  rgba(245, 184, 0, 0.12);
        --sl-blue:      #3b82f6;   /* UCL */
        --sl-orange:    #f97316;   /* UEL */
        --sl-red:       #e05050;   /* spadek / porażki */
        --sl-green:     #3ecf70;
        --sl-font:      -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
 
        font-family: var(--sl-font);
        background:  var(--sl-bg);
        color:       var(--sl-text);
        border:      1px solid var(--sl-border);
        border-radius: 10px;
        overflow: hidden;
        max-width: 860px;
        margin: 0 auto;
        font-size: 14px;
        box-shadow: 0 4px 32px rgba(0,0,0,0.5);
    }

    .juve-standings-root[data-view="kompaktowy"] {
        margin: 0 0 30px;
    }
 
    /* Nagłówek widżetu */
    .jls-sl-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        border-bottom: 1px solid var(--sl-border);
        background: var(--sl-surface);
    }
 
    .jls-sl-header-logo {
        width: 28px; height: 28px;
        object-fit: contain;
    }
 
    .jls-sl-header-title {
        font-size: 15px;
        font-weight: 700;
        color: var(--sl-text);
        letter-spacing: -0.2px;
    }
 
    .jls-sl-header-season {
        font-size: 11px;
        color: var(--sl-muted);
        margin-left: auto;
        letter-spacing: .05em;
        text-transform: uppercase;
    }
 
    /* Tabela */
    .jls-sl-table {
        width: 100%;
        border-collapse: collapse;
    }
 
    .jls-sl-table thead th {
        background: var(--sl-surface);
        color: var(--sl-muted);
        font-size: 10px;
        font-weight: 600;
        text-align: center;
        padding: 9px 6px;
        border-bottom: 1px solid var(--sl-border);
        white-space: nowrap;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
 
    .jls-sl-table thead th.th-pos   { width: 44px; }
    .jls-sl-table thead th.th-team  { text-align: left; padding-left: 10px; min-width: 160px; }
    .jls-sl-table thead th.th-pts   { color: var(--sl-text); }
 
    /* Wiersze */
    .jls-sl-table tbody tr {
        border-bottom: 1px solid var(--sl-border);
        transition: background .1s;
    }
 
    .jls-sl-table tbody tr:last-child { border-bottom: none; }
    .jls-sl-table tbody tr:hover      { background: var(--sl-surface2); }
 
    .jls-sl-table tbody tr.row-juve {
        background: var(--sl-gold-dim);
    }
    .jls-sl-table tbody tr.row-juve:hover { background: rgba(245,184,0,.18); }
 
    /* Komórki */
    .jls-sl-table td {
        padding: 10px 6px;
        text-align: center;
        color: var(--sl-text);
        font-size: 13px;
    }
 
    /* Kolumna pozycji */
    td.td-pos {
        font-size: 12px;
        color: var(--sl-muted);
        font-weight: 500;
        width: 44px;
        padding-left: 12px;
        text-align: left;
    }
 
    /* Kolumna drużyny */
    td.td-team {
        text-align: left;
        padding-left: 6px;
    }
 
    .jls-sl-team-cell {
        display: flex;
        align-items: center;
        gap: 10px;
    }
 
    .jls-sl-team-logo {
        width: 22px; height: 22px;
        object-fit: contain;
        flex-shrink: 0;
    }
 
    .jls-sl-team-name {
        font-weight: 500;
        font-size: 13px;
        color: var(--sl-text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }
 
    .row-juve .jls-sl-team-name {
        color: var(--sl-gold);
        font-weight: 600;
    }
 
    /* Porażki — czerwona liczba */
    td.td-lose { color: var(--sl-red); }
 
    /* Punkty */
    td.td-pts {
        font-weight: 700;
        font-size: 14px;
        color: var(--sl-text);
    }
    .row-juve td.td-pts { color: var(--sl-gold); }
 
    /* Bilans bramek */
    td.td-goals {
        font-size: 13px;
        white-space: nowrap;
    }
 
    /* Bilans +/- */
    td.td-gd { font-size: 13px; }
    td.td-gd.pos { color: var(--sl-green); }
    td.td-gd.neg { color: var(--sl-red); }
 
    /* Kolorowy pasek strefy przy pozycji */
    /* .jls-sl-zone {
        display: inline-block;
        width: 3px; height: 16px;
        border-radius: 2px;
        vertical-align: middle;
        margin-right: 6px;
    }
    .zone-ucl  { background: var(--sl-blue); }
    .zone-uel  { background: var(--sl-orange); }
    .zone-rel  { background: var(--sl-red); }
    .zone-none { background: transparent; } */
 
    /* Legenda stref */
    .jls-sl-legend {
        display: flex;
        gap: 18px;
        padding: 10px 16px;
        border-top: 1px solid var(--sl-border);
        background: var(--juve-surface);
        flex-wrap: wrap;
    }
 
    .jls-sl-legend-item {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
        color: var(--sl-muted);
    }
 
    .jls-sl-legend-dot {
        width: 9px; height: 9px;
        border-radius: 2px;
        flex-shrink: 0;
    }
 
    /* Loader */
    .jls-sl-loader {
        padding: 48px 20px;
        text-align: center;
        color: var(--sl-muted);
        font-size: 13px;
    }
 
    .jls-sl-spinner {
        width: 26px; height: 26px;
        border: 2px solid var(--sl-border);
        border-top-color: var(--sl-gold);
        border-radius: 50%;
        animation: sl-spin .8s linear infinite;
        margin: 0 auto 12px;
    }
 
    @keyframes sl-spin { to { transform: rotate(360deg); } }
 
    .jls-sl-error {
        padding: 32px 20px;
        text-align: center;
        color: var(--sl-red);
        font-size: 13px;
    }
 
    .jls-sl-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        border-top: 1px solid var(--sl-border);
        background: var(--sl-surface);
    }
 
    .jls-sl-updated {
        font-size: 11px;
        color: var(--sl-muted);
    }
 
    .jls-sl-refresh {
        background: none;
        border: 1px solid var(--sl-border);
        color: var(--sl-muted);
        font-size: 11px;
        padding: 4px 10px;
        border-radius: 5px;
        cursor: pointer;
        font-family: var(--sl-font);
        transition: color .15s, border-color .15s;
    }
    .jls-sl-refresh:hover { color: var(--sl-text); border-color: var(--sl-muted); }
 
    /* Responsywność */
    @media (max-width: 600px) {
        .jls-sl-table thead th.th-gd,
        .jls-sl-table td.td-gd { display: none; }
        .jls-sl-team-name { max-width: 110px; }
    }
    @media (max-width: 440px) {
        .jls-sl-table thead th.th-goals,
        .jls-sl-table td.td-goals { display: none; }
    }
