/* Składy w artykule — style inline w HTML + ten plik na froncie (main.php) */
.plive-sklady-embed { margin: 14px 0; clear: both; max-width: 100%; box-sizing: border-box; }

/* Etykieta tylko w edytorze CMS — na stronie artykułu ukrywa body.article-single */
.plive-sklady-embed__label { margin: 0 0 8px; font-weight: 700; font-size: 13px; line-height: 1.3; color: #1565c0; }
.plive-sklady-embed__label.plive-sklady-embed__cms-only {
    padding: 6px 10px;
    background: #e3f2fd;
    border: 1px dashed #90caf9;
    border-radius: 4px;
}
body.article-single .plive-sklady-embed__cms-only { display: none !important; }

.plive-sklady-embed__warn {
    margin: 0 0 10px;
    padding: 8px 10px;
    background: #fff8e6;
    border: 1px solid #e6c200;
    border-radius: 6px;
    font-size: 12px;
    color: #856404;
}

/* Zawsze 2 kolumny — także na telefonie */
.plive-sklady-embed .match-sklady,
.match-sklady--article-embed {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px;
    margin: 0;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.plive-sklady-embed .match-sklad-block,
.match-sklady--article-embed .match-sklad-block {
    min-width: 0;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e2e4e8;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.plive-sklady-embed .match-sklad-header,
.match-sklady--article-embed .match-sklad-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 11px;
    color: #222;
    margin: 0;
    padding: 6px 8px;
    background: #f3f4f6;
    border-bottom: 1px solid #e2e4e8;
    flex-shrink: 0;
    min-height: 36px;
    box-sizing: border-box;
}

.plive-sklady-embed .match-sklad-header__crest,
.match-sklady--article-embed .match-sklad-header__crest {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.plive-sklady-embed .match-sklad-header__text,
.match-sklady--article-embed .match-sklad-header__text {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.plive-sklady-embed .match-sklad-header__name,
.match-sklady--article-embed .match-sklad-header__name {
    display: block;
    font-weight: 700;
    font-size: 11px;
    color: #222;
    line-height: 1.2;
    word-break: break-word;
}

.plive-sklady-embed .match-sklad-formation,
.match-sklady--article-embed .match-sklad-formation {
    display: block;
    font-weight: 600;
    color: #666;
    font-size: 10px;
    line-height: 1.2;
}

.plive-sklady-embed .match-sklad-lines,
.match-sklady--article-embed .match-sklad-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 4px 6px;
}

/* Flex zamiast sztywnej siatki 11 wierszy — bez „dziur” przy 5-3-2 itd. */
.plive-sklady-embed .match-sklad-starters.match-sklad-lines,
.match-sklady--article-embed .match-sklad-starters.match-sklad-lines {
    display: flex !important;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    height: auto;
    padding: 4px 6px;
}

.plive-sklady-embed .match-sklad-starters > .match-sklad-row,
.match-sklady--article-embed .match-sklad-starters > .match-sklad-row {
    height: auto;
    min-height: 30px;
    max-height: none;
    overflow: visible;
    margin: 0;
}

.plive-sklady-embed .match-sklad-row,
.match-sklady--article-embed .match-sklad-row {
    display: block;
    padding: 0;
    border: none;
}

.plive-sklady-embed .match-sklad-player-bar,
.match-sklady--article-embed .match-sklad-player-bar {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 4px;
    align-items: center;
    min-height: 30px;
    height: auto;
    padding: 3px 5px;
    background: #f3f3f3;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #222;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.plive-sklady-embed .match-sklad-pos-col,
.match-sklady--article-embed .match-sklad-pos-col {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    min-width: 20px;
    max-width: 20px;
}

.plive-sklady-embed .match-sklad-name-col,
.match-sklady--article-embed .match-sklad-name-col {
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.plive-sklady-embed .match-sklad-name,
.plive-sklady-embed .match-sklad-name--plain,
.match-sklady--article-embed .match-sklad-name,
.match-sklady--article-embed .match-sklad-name--plain {
    color: #222;
    text-decoration: none;
    line-height: 1.2;
    display: block;
    font-size: 10px;
    font-weight: 700;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

.plive-sklady-embed .match-sklad-events-wrap,
.match-sklady--article-embed .match-sklad-events-wrap {
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    max-width: none;
    overflow: visible;
}

.plive-sklady-embed .match-sklad-pos,
.match-sklady--article-embed .match-sklad-pos {
    flex-shrink: 0;
    display: inline-block;
    min-width: 16px;
    padding: 1px 3px;
    background: #ececec;
    color: #555;
    font-size: 7px;
    font-weight: 700;
    text-align: center;
    border-radius: 3px;
    border: 1px solid #d8d8d8;
    box-sizing: border-box;
}

.plive-sklady-embed .match-sklad-pos--spacer,
.match-sklady--article-embed .match-sklad-pos--spacer {
    visibility: hidden;
    background: transparent;
    border-color: transparent;
    min-width: 16px;
    min-height: 14px;
}

.plive-sklady-embed .match-sklad-label,
.match-sklady--article-embed .match-sklad-label {
    display: inline-block;
    margin: 0 6px 3px;
    padding: 2px 6px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    background: #318223;
    border-radius: 3px;
}

.plive-sklady-embed .match-sklad-bench,
.match-sklady--article-embed .match-sklad-bench {
    margin: 0;
    padding: 4px 0 6px;
    border-top: 1px solid #eee;
}

.plive-sklady-embed .match-sklad-bench .match-sklad-player-bar,
.match-sklady--article-embed .match-sklad-bench .match-sklad-player-bar {
    min-height: 28px;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    font-size: 9px;
}

.plive-sklady-embed .match-sklad-bench .match-sklad-pos-col,
.match-sklady--article-embed .match-sklad-bench .match-sklad-pos-col {
    width: 20px;
    min-width: 20px;
    max-width: 20px;
}

.plive-sklady-embed .match-sklad-bench--used-only .match-sklad-name,
.plive-sklady-embed .match-sklad-bench--used-only .match-sklad-name--plain,
.match-sklady--article-embed .match-sklad-bench--used-only .match-sklad-name,
.match-sklady--article-embed .match-sklad-bench--used-only .match-sklad-name--plain {
    font-size: 9px;
    line-height: 1.2;
}

.plive-sklady-embed .match-sklad-events,
.match-sklady--article-embed .match-sklad-events {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: flex-end;
    line-height: 1;
}

.plive-sklady-embed .match-sklad-event,
.match-sklady--article-embed .match-sklad-event {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    font-size: 7px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.plive-sklady-embed .match-sklad-event img,
.match-sklady--article-embed .match-sklad-event img {
    width: 10px;
    height: 10px;
    object-fit: contain;
}

.plive-sklady-embed .match-sklad-referee,
.match-sklady--article-embed .match-sklad-referee {
    margin: 8px 0 0;
    padding: 6px 8px;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 11px;
    grid-column: 1 / -1;
}
