.gallery-page-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.gallery-page-layout > .gallery-content-container,
.gallery-page-layout > .art-gallery-content {
    flex: 1;
    min-width: 0;
    margin: 10px;
    margin-right: 25px;
}

.gallery-page-layout > #main-content-column-2 {
    flex-shrink: 0;
    margin: 10px;
}

.profile-friends-section {
    width: 100%;
}

.friends-ranking-container {
    width: 310px;
    min-height: 485px;
    height: auto;
    border: 6px solid #00c8ff;
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
    border-radius: 30px;
    position: relative;
    margin-top: 20px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    padding-bottom: 8px;
    justify-self: center;
}

.friends-ranking-title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    background: linear-gradient(45deg, #4d77ff, #00c8ff);
    color: white;
    margin: 0;
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid #00c8ff;
    padding: 7px 12px 7px 12px;
    white-space: nowrap;
    cursor: default;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.friends-count-badge {
    font-size: 0.85em;
    font-weight: bold;
}

.icon-container {
    position: relative;
    display: flex;
}

.icon-profile-friends-title {
    width: 24px;
    height: 24px;
    margin-top: 2px;
}

.friends-search-wrap {
    margin: 56px 12px 12px;
}

.friends-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border-radius: 5px;
    border: 1.5px solid rgb(0 200 255);
    background: linear-gradient(135deg, rgb(0 115 255 / 48%) 0%, rgb(58 204 252 / 42%) 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Montserrat', sans-serif;
}

.friends-search-input:focus {
    border-color: #00c8ff;
    box-shadow: 0 0 0 2px rgba(0, 200, 255, 0.15);
}

.friends-search-input::placeholder {
    color: #ffffff;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.friends-ranking-content {
    flex: 1;
    padding: 4px 10px 6px;
    min-height: 335px;
    display: flex;
    flex-direction: column;
}

.friends-loading,
.friends-empty {
    color: #4299e1;
    font-size: 0.88rem;
    font-style: italic;
}

.friends-rank-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
}

.friend-rank-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    border-radius: 3px;
    text-decoration: none !important;
    color: #2d3748;
    border: 1px solid rgb(0 123 255 / 18%);
    transition: background 0.2s, transform 0.15s, border-color 0.2s;
    cursor: pointer;
    min-height: 80px;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.friend-rank-card:hover {
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.18), rgba(77, 119, 255, 0.14));
    border-color: rgba(0, 200, 255, 0.4);
    transform: translateY(-2px);
    overflow: visible;
    z-index: 10;
}

.friend-rank-card--empty {
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed rgba(0, 200, 255, 0.12);
    cursor: default;
    pointer-events: none;
    min-height: 80px;
}

.friend-rank-top {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 5px 5px 5px 5px;
    box-sizing: border-box;
    min-width: 0;
    text-align: center;
}

.friend-rank-avatar-wrap {
    display: flex;
    position: relative;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    margin-bottom: 5px;
}

.friend-rank-avatar {
    width: 70px;
    height: 70px;
    border-radius: 10%;
    object-fit: cover;
    display: block;
}

.friend-rank-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border-radius: 30%;
    border: 2px solid #fff;
    box-sizing: border-box;
}

.friend-rank-status-dot.status-online  { background: #1be41c; box-shadow: 0 0 4px #01ff6b; }
.friend-rank-status-dot.status-playing { background: #1be41c; box-shadow: 0 0 4px #01ff6b; }
.friend-rank-status-dot.status-offline { background: #c5c7ca; }

.friend-rank-name {
    font-size: 0.75rem;
    color: #1b1b1b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    letter-spacing: 0.05em;
}

.friends-rank-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 2rem 1rem;
    flex: 1;
    text-align: center;
}

.friends-rank-empty-icon { font-size: 2.2rem; opacity: 0.45; }

.friends-rank-empty-text {
    font-size: 0.82rem;
    color: #4a5568;
    line-height: 1.5;
}

.friends-rank-empty-text strong { color: #4299e1; }

.friends-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 15px 8px 4px;
    border-top: 1px solid rgba(0, 200, 255, 0.15);
    flex-wrap: wrap;
}

.friends-page-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 6px;
    border: 1px solid rgba(77, 119, 255, 0.3);
    background: rgba(255, 255, 255, 0.7);
    color: #4d77ff;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
}

.friends-page-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.2), rgba(77, 119, 255, 0.15));
    border-color: #00c8ff;
    color: #2b4db3;
}

.friends-page-btn--active {
    background: linear-gradient(135deg, #4d77ff, #00c8ff);
    border-color: #00c8ff;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 200, 255, 0.3);
}

.friends-page-btn:disabled {
    cursor: default;
}

[data-tip]::before {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: linear-gradient(135deg, #8100ff 0%, #1199c5 100%);
    color: #f0e6ff;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.45;
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-clip: padding-box;
    white-space: normal;
    max-width: 320px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
    box-shadow:
        0 0 0 1px rgba(129, 0, 255, 0.45),
        0 0 12px rgba(129, 0, 255, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-tip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 5px solid transparent;
    border-top-color: rgba(129, 0, 255, 0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
}

[data-tip]:hover::before,
[data-tip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ban-slot2 {
    width: 310px;
    height: 250px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    background: rgb(91 91 91 / 20%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    text-align: center;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    margin: 10px 0;
}

.ban-slot2:hover { opacity: 1; }

.slot-text {
    color: #fff;
    font-weight: bold;
}

@media only screen and (orientation: portrait), (max-aspect-ratio: 4/3) {


    #main-content-column-2 {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 5px 30px !important;
        margin: 0 !important;
    }

    #main-content-column-2 .profile-friends-section {
        order: 2;
    }

    #main-content-column-2 .pr0m0-area {
        order: 3;
        
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 50px !important;
        background: #ffffff !important;
        border-top: 1.5px dashed rgba(77, 119, 255, 0.25) !important;
        z-index: 50 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .friends-ranking-container {
        width: 100%;
        margin-top: 10px;
        border-radius: 20px;
        border-width: 4px;
        padding: 0px 8px 16px;
    }

    .friends-search-input {
        padding: 12px 12px;
    }

    .ban-slot2 {
        width: 100% !important;
        max-width: 100% !important;
        height: 50px !important;
        border: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        margin: 0 !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        font-size: 0.65rem !important;
        color: #a0aec0 !important;
        font-weight: normal !important;
        opacity: 1 !important;
    }

    .ban-slot2 .slot-text {
        color: #a0aec0 !important;
        font-weight: normal !important;
    }

}

@media only screen and (max-width: 1024px) and (orientation: landscape) {
    #main-content-column-2 {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 5px 30px !important;
        margin: 0 !important;
    }

    #main-content-column-2 .profile-friends-section {
        order: 2;
    }

    #main-content-column-2 .pr0m0-area {
        order: 3;
        
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 50px !important;
        background: #ffffff !important;
        border-top: 1.5px dashed rgba(77, 119, 255, 0.25) !important;
        z-index: 50 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .friends-ranking-container {
        width: 100%;
        margin-top: 10px;
        border-radius: 20px;
        border-width: 4px;
        padding: 0px 8px 16px;
    }

    .friends-search-input {
        padding: 12px 12px;
    }

    .ban-slot2 {
        width: 100% !important;
        max-width: 100% !important;
        height: 50px !important;
        border: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        margin: 0 !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        font-size: 0.65rem !important;
        color: #a0aec0 !important;
        font-weight: normal !important;
        opacity: 1 !important;
    }

    .ban-slot2 .slot-text {
        color: #a0aec0 !important;
        font-weight: normal !important;
    }
}