/* =========================================================
   Spieler-Steckbrief (Modal)
========================================================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    padding: 1.25rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
}

.modal.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: min(100%, 32rem);
    margin: auto;
    padding: 0;
}

.modal .close-btn {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(21, 23, 28, 0.9);
    color: var(--text-color);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.modal .close-btn:hover,
.modal .close-btn:focus-visible {
    color: var(--main-brand-color);
    border-color: var(--main-brand-color);
    outline: none;
}

#profile-container {
    padding: 0;
    overflow: visible;
}

/* ---- Profil-Karte ---- */

.profile-card {
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(13, 188, 249, 0.28);
    background: linear-gradient(165deg, #1e242e 0%, #15171c 55%);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 0 48px rgba(13, 188, 249, 0.12);
}

.profile-card__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1.35rem;
    background: linear-gradient(135deg, rgba(13, 188, 249, 0.18) 0%, transparent 70%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.profile-card__title {
    width: 100%;
    max-width: 100%;
    text-align: center;
}

.profile-card__photo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--main-brand-color);
    box-shadow: 0 0 24px rgba(13, 188, 249, 0.35);
    background: var(--light-secondary-color);
}

.profile-card__photo img {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    object-fit: cover;
    object-position: center center;
    display: block;
    transform: none;
    box-shadow: none;
}

.profile-card__eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--main-brand-color);
}

@media (min-width: 768px) {
    .profile-card__header {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 1.15rem;
    }

    .profile-card__photo {
        margin: 0;
    }

    .profile-card__title {
        width: auto;
        flex: 0 1 auto;
    }

    .profile-card__name {
        margin: 0;
    }
}

.profile-card__name {
    margin: 0 auto;
    font-size: clamp(1.25rem, 4vw, 1.55rem);
    line-height: 1.15;
    font-weight: 700;
    color: var(--text-color);
}

.profile-card__body {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: min(58vh, 26rem);
    overflow-y: auto;
    padding: 0.35rem 0;
}

.profile-detail {
    display: grid;
    grid-template-columns: minmax(7.5rem, 42%) 1fr;
    gap: 0.65rem 1rem;
    align-items: baseline;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-detail:last-child {
    border-bottom: none;
}

.profile-detail-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--main-brand-color);
    line-height: 1.35;
}

.profile-detail-value {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--secondary-text-color);
    word-break: break-word;
}

.profile-detail:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Legacy-Klassen (Fallback) */
.profile {
    display: none;
}

@media (max-width: 767px), (max-width: 932px) and (max-height: 430px) {
    .modal {
        padding: 0.75rem;
        align-items: center;
    }

    .modal-content {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .modal .close-btn {
        position: relative;
        top: auto;
        right: auto;
        align-self: flex-end;
        margin: 0 0 0.65rem;
    }

    .profile-card__header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        padding: 1.35rem 1.25rem 1.15rem;
        text-align: center;
    }

    .profile-card__photo {
        margin-inline: auto;
    }

    .profile-card__title {
        width: 100%;
        text-align: center;
    }

    .profile-card__name {
        margin-inline: auto;
    }

    .profile-detail {
        grid-template-columns: 1fr;
        gap: 0.3rem;
        padding: 0.75rem 1.15rem;
    }
}

@supports (-webkit-touch-callout: none) {
    @media (max-width: 932px) {
        .modal-content {
            display: flex;
            flex-direction: column;
            align-items: stretch;
        }

        .modal .close-btn {
            position: relative;
            top: auto;
            right: auto;
            align-self: flex-end;
            margin: 0 0 0.65rem;
        }

        .profile-card__header {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            justify-items: center;
            padding: 1.35rem 1.25rem 1.15rem;
            text-align: center;
        }

        .profile-card__photo,
        .profile-card__title,
        .profile-card__name {
            margin-inline: auto;
            text-align: center;
        }
    }
}

@media (max-width: 480px) {
    .profile-detail {
        padding: 0.75rem 1.15rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .modal.is-open .profile-card {
        animation: profile-card-in 0.28s ease-out;
    }
}

@keyframes profile-card-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
