/* KirSRV profile responsive v3 */

.portal-main--profile,
.player-profile,
.profile-shell,
.profile-content,
.profile-aside,
.wall-card,
.activity-card,
.stats-card,
.comments-card {
    min-width: 0;
    max-width: 100%;
}

.player-profile {
    width: 100%;
    overflow: visible;
}

/* Hero */
.player-profile .profile-hero--compact {
    width: 100%;
    overflow: visible;
}

.player-profile .profile-hero__identity {
    min-width: 0;
}

.player-profile .profile-hero__head {
    display: block !important;
    flex: 0 0 auto;
    width: 88px !important;
    height: 88px !important;
    max-width: 88px !important;
    border-radius: 18px;
    object-fit: cover;
    image-rendering: pixelated;
}

.player-profile .profile-hero__head.placeholder {
    display: grid !important;
    place-items: center;
}

.player-profile .profile-hero__name {
    min-width: 0;
}

.player-profile .profile-hero__name h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.player-profile .presence-pill {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Main profile grid */
.player-profile .profile-shell--v17 {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.player-profile .profile-aside--v17,
.player-profile .profile-content--v17 {
    min-width: 0;
}

/* Skin */
.player-profile .skin-card--full {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 390px;
    display: grid !important;
    place-items: center;
    padding: 20px;
    overflow: hidden;
}

.player-profile .skin-card--full .profile-skin-image,
.player-profile .skin-card--full > img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 430px !important;
    min-width: 0 !important;
    margin: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    image-rendering: pixelated;
}

/* Wall/media */
.player-profile .wall-feed,
.player-profile .wall-feed-post,
.player-profile .wall-post-comments,
.player-profile .wall-post-comment,
.player-profile .profile-comment {
    min-width: 0;
    max-width: 100%;
}

.player-profile .wall-feed-post__head,
.player-profile .profile-comment__head {
    min-width: 0;
}

.player-profile .wall-feed-post__head > div,
.player-profile .profile-comment__content {
    min-width: 0;
}

.player-profile .wall-feed-post__head b,
.player-profile .profile-comment__head b,
.player-profile .wall-feed-post__body,
.player-profile .profile-comment p {
    overflow-wrap: anywhere;
}

.player-profile .wall-feed-post__media {
    max-width: 100%;
    height: auto;
}

.player-profile video.wall-feed-post__media {
    width: 100%;
}

/* Forms */
.player-profile input,
.player-profile textarea,
.player-profile button,
.player-profile select {
    max-width: 100%;
    box-sizing: border-box;
}

.player-profile .wall-inline-comment {
    min-width: 0;
}

.player-profile .wall-inline-comment input {
    min-width: 0;
    width: 100%;
}

/* Activity / stats */
.player-profile .activity-summary,
.player-profile .stats-grid {
    min-width: 0;
}

.player-profile .heatmap-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.player-profile .heatmap {
    min-width: 650px;
}

/* Bans / warnings */
.player-profile .ban-banner,
.player-profile .warning-card,
.player-profile .warnings-section {
    min-width: 0;
    max-width: 100%;
}

.player-profile .ban-banner__copy,
.player-profile .ban-banner__issuer,
.player-profile .warning-card__body {
    min-width: 0;
}

/* Tablet */
@media (max-width: 980px) {
    .portal-main--profile {
        width: min(100% - 24px, 1320px) !important;
    }

    .player-profile .profile-shell--v17 {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .player-profile .profile-aside--v17 {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .player-profile .skin-card--full {
        grid-column: 1 / -1;
        min-height: 340px;
    }

    .player-profile .skin-card--full .profile-skin-image,
    .player-profile .skin-card--full > img {
        max-height: 310px !important;
    }
}

/* Phones */
@media (max-width: 700px) {
    .portal-main--profile {
        width: min(100% - 16px, 1320px) !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .player-profile .profile-hero--compact {
        border-radius: 18px !important;
    }

    .player-profile .profile-hero__identity {
        display: grid !important;
        grid-template-columns: 68px minmax(0, 1fr) !important;
        gap: 12px !important;
        align-items: center !important;
    }

    .player-profile .profile-hero__head {
        width: 68px !important;
        height: 68px !important;
        max-width: 68px !important;
        border-radius: 14px;
    }

    .player-profile .profile-hero__name h1 {
        font-size: clamp(26px, 9vw, 38px) !important;
        line-height: 1 !important;
    }

    .player-profile .presence-pill {
        grid-column: 1 / -1;
        width: 100%;
        box-sizing: border-box;
        justify-content: flex-start;
    }

    .player-profile .profile-aside--v17 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-profile .skin-card--full {
        min-height: 315px;
        padding: 14px;
    }

    .player-profile .skin-card--full .profile-skin-image,
    .player-profile .skin-card--full > img {
        max-height: 285px !important;
    }

    .player-profile .profile-mini-card:last-child {
        grid-column: 1 / -1;
    }

    .player-profile .section-title-row,
    .player-profile .wall-title-row {
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .player-profile .wall-title-row {
        flex-direction: column !important;
    }

    .player-profile .wall-title-row > .btn {
        width: 100%;
        justify-content: center;
    }

    .player-profile .activity-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .player-profile .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .player-profile .wall-feed-post {
        padding-left: 13px !important;
        padding-right: 13px !important;
    }

    .player-profile .wall-post-comment,
    .player-profile .profile-comment {
        align-items: flex-start !important;
    }

    .player-profile .comment-compose--inline {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .player-profile .comment-compose--inline .btn {
        width: 100%;
        justify-content: center;
    }

    .player-profile .ban-banner {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .player-profile .ban-banner__issuer,
    .player-profile .ban-banner > .btn {
        grid-column: 1 / -1;
    }

    .player-profile .ban-banner > .btn {
        width: 100%;
        justify-content: center;
    }

    .player-profile .warning-card {
        grid-template-columns: auto minmax(0, 1fr) !important;
    }

    .player-profile .warning-card > time {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .wall-composer-dialog {
        width: calc(100vw - 10px) !important;
        max-height: calc(100dvh - 10px) !important;
        border-radius: 17px !important;
    }

    .wall-composer-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .wall-composer-preview {
        min-width: 0 !important;
    }
}

@media (max-width: 430px) {
    .player-profile .profile-aside--v17 {
        grid-template-columns: 1fr;
    }

    .player-profile .profile-mini-card:last-child {
        grid-column: auto;
    }

    .player-profile .skin-card--full {
        min-height: 290px;
    }

    .player-profile .skin-card--full .profile-skin-image,
    .player-profile .skin-card--full > img {
        max-height: 260px !important;
    }

    .player-profile .activity-summary,
    .player-profile .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .player-profile .profile-hero__identity {
        grid-template-columns: 58px minmax(0, 1fr) !important;
    }

    .player-profile .profile-hero__head {
        width: 58px !important;
        height: 58px !important;
        max-width: 58px !important;
    }
}
