img[src*="/crests/image/"] { object-fit: contain !important; border-radius: 0 !important; }
#crest-gallery { width:min(92vw,540px); max-height:90vh; overflow:auto; border:1px solid #416052; border-radius:18px; padding:20px; background:#14251d; color:#edf5ef; }
#crest-gallery::backdrop { background:#000a; }
#crest-gallery .crest-header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#crest-gallery .crest-view { display:flex; align-items:center; justify-content:center; gap:12px; }
#crest-gallery .crest-picture { width:min(48vw,240px); aspect-ratio:1; display:grid; place-items:center; background:repeating-conic-gradient(#e7e7e7 0% 25%,#ccc 0% 50%) 50% / 20px 20px; border-radius:12px; }
#crest-img { max-width:95%; max-height:95%; object-fit:contain; }
#crest-gallery [hidden] { display:none !important; }
#crest-gallery p { margin:10px 0; }

/* PANTEROWNIA_CREST_UI_V3_START */
/* Herby: duze, bez dwoch ramek. Celujemy tylko w obrazki z naszego modulu. */
.match-card .team-crest:has(> img[src*="/crests/image/"]) {
    width: 66px !important;
    height: 66px !important;
    flex: 0 0 66px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}
.match-card .team-crest > img.team-flag[src*="/crests/image/"] {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    object-fit: contain !important;
    object-position: center !important;
}
/* Male herby w panelu druzyn – rowniez bez ramek i w poprawnych proporcjach. */
.team-mini-crest:has(> img[src*="/crests/image/"]) {
    width: 40px !important;
    height: 40px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.team-mini-crest > img.team-flag[src*="/crests/image/"] {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: contain !important;
}
/* Tabela ligowa: prostokatny format flag nie moze sciskac tarczy klubu. */
.table-wrap td > img.team-flag[src*="/crests/image/"] {
    width: 36px !important;
    height: 36px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: contain !important;
    vertical-align: middle;
}
@media (max-width: 900px) {
    .match-card .team-crest:has(> img[src*="/crests/image/"]) {
        width: 50px !important;
        height: 50px !important;
        flex: 0 0 50px !important;
    }
}
@media (max-width: 380px) {
    .match-card .team-crest:has(> img[src*="/crests/image/"]) {
        width: 40px !important;
        height: 40px !important;
        flex: 0 0 40px !important;
    }
}
/* PANTEROWNIA_CREST_UI_V3_END */
