/* ============================================================
   UHCM Spieler — Frontend Widget
   ============================================================ */

.uhcm-spieler-widget {
    --uhcm-cols: 3;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- Gruppen-Header (Titel) --- */
.uhcm-spieler-group-header {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 16px;
    border-radius: 6px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.uhcm-spieler-group-header:first-child {
    margin-top: 0;
}

/* --- Grid (Spalten) --- */
.uhcm-spieler-grid {
    display: grid;
    grid-template-columns: repeat(var(--uhcm-cols), 1fr);
    gap: 12px;
}

/* --- Card: gemeinsam --- */
.uhcm-spieler-card {
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.uhcm-spieler-card.has-detail {
    cursor: pointer;
}

.uhcm-spieler-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* --- Card Body (Name + Position) --- */
.uhcm-spieler-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px 12px;
}

.uhcm-spieler-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.uhcm-spieler-pos {
    font-size: 12px;
    font-weight: 500;
}

/* --- Nummer inline (ohne Foto) --- */
.uhcm-spieler-nr-inline {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* --- Card mit Foto --- */
.uhcm-spieler-foto-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.uhcm-spieler-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.uhcm-spieler-card:hover .uhcm-spieler-foto {
    filter: grayscale(0%);
}

.uhcm-spieler-nr-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* --- Card anonymisiert (nur Name) --- */
.uhcm-card-anon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    text-align: center;
}

.uhcm-card-anon .uhcm-spieler-name {
    font-size: 15px;
}

/* --- Popup / Overlay --- */
.uhcm-spieler-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.uhcm-spieler-popup {
    background: #fff;
    border-radius: 12px;
    max-width: 380px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: uhcm-spieler-popup-in 0.2s ease;
    overflow: hidden;
}

@keyframes uhcm-spieler-popup-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.uhcm-spieler-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(0,0,0,0.4);
    border: none;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 1;
}

.uhcm-spieler-popup-close:hover {
    background: rgba(0,0,0,0.7);
}

.uhcm-spieler-popup-foto {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
}

.uhcm-spieler-popup-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 16px 20px 4px;
}

.uhcm-spieler-popup-nr {
    font-size: 22px;
    font-weight: 800;
    color: #9ca3af;
}

.uhcm-spieler-popup-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.uhcm-spieler-popup-pos {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    padding: 0 20px 12px;
}

.uhcm-spieler-popup-table {
    width: 100%;
    border-collapse: collapse;
    padding: 0 20px;
}

.uhcm-spieler-popup-table td {
    padding: 6px 20px;
    font-size: 13px;
    border-top: 1px solid #f3f4f6;
}

.uhcm-spieler-popup-table tr:first-child td {
    border-top: none;
}

.uhcm-spieler-popup-table td:first-child {
    color: #6b7280;
    font-weight: 400;
    width: 110px;
}

.uhcm-spieler-popup-table td:last-child {
    font-weight: 600;
    color: #1f2937;
}

.uhcm-spieler-popup-table tr:last-child td {
    padding-bottom: 16px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .uhcm-spieler-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .uhcm-spieler-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .uhcm-spieler-popup {
        max-width: 300px;
    }

    .uhcm-spieler-group-header {
        font-size: 12px;
        padding: 8px 12px;
    }
}
