.search {
    text-align: center;
    padding-top: 60px;
    position: relative;
    display: inline-block;
    width: fit-content;
}

.search-form__input {
    width: 1000px;
    border: solid 3px;
    border-image-slice: 1;
    border-image-source: linear-gradient(to right, #ff416c, #3a0ca3);
    padding: 20px;
    background: #1a1a1a;
    font-size: 1.5em;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-optical-sizing: auto;
    font-weight: 200;
    font-style: normal;
}

.search-loader {
    position: absolute;
    top: calc(50% + 29px);
    right: 15px;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: 3px solid #fff;
    border-top: 3px solid #ff4cc7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 10;
}

@keyframes spin {
    0%   { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    border-left: 1px solid transparent;
    border-right: 1px solid transparent;
    border-bottom: 1px solid transparent;
    border-top: none;
    border-image-slice: 1;
    border-image-source: linear-gradient(to bottom right, #ff416c, #3a0ca3);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.9);
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
}

.search-dropdown::-webkit-scrollbar       { width: 14px; }
.search-dropdown::-webkit-scrollbar-track { background: #111; margin: 0 -1px; }
.search-dropdown::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

.search-dropdown {
    scrollbar-width: auto;
    scrollbar-color: #666 #111;
}

.search-dropdown__status {
    padding: 14px 20px;
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 200;
    font-size: 1.2rem;
    color: #888;
    text-align: center;
}

.search-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 4px 0 0;
}

.search-item {
    cursor: pointer;
    transition: background 0.12s ease;
}

.search-item--active,
.search-item:hover {
    background: #2a1a2e;
}

.search-item__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 16px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.search-item__cover-wrap {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-item__cover {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    background: #2c2c2c;
    position: absolute;
    inset: 0;
}

.search-item__cover-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border: 2px solid #fff;
    border-top-color: #ff4cc7;
    border-radius: 50%;
    animation: spinCenter 1s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes spinCenter {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.search-item__vip-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: #6c2bd9;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.6rem;
    letter-spacing: 1px;
    padding: 1px 5px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
}

.search-item__nicknames {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
    color: #eee;
}

.search-item__nickname,
.search-item__nickname-sep,
.search-item__tag {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 200;
    font-size: 1.2rem;
}

.search-item__nickname {
    color: #eee;
}

.search-item__nickname-sep {
    color: #555;
}

.search-item__tag {
    color: #aaa;
}

.search-item__nickname--match {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.search-see-all {
    position: sticky;
    bottom: 0;
    border-top: 1px solid #2a2a2a;
    background-color: #1a1a1a;
    z-index: 3;
}

.search-see-all__link {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 200;
    font-size: 1rem;
    color: #00f0ff;
    background: none;
    border: none;
    text-align: center;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.search-see-all__link:hover {
    background: rgba(0, 240, 255, 0.08);
    color: #fff;
}

@media (max-width: 1024px) {
    .search {
        padding-top: 40px;
        width: 100%;
    }

    .search-form__input {
        width: 90%;
        font-size: 1.2em;
        padding: 16px;
    }

    .search-loader {
        top: calc(50% + 20px);
        right: calc(5% + 10px);
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .search-loader {
        width: 38px;
        height: 38px;
    }

    .search-dropdown {
        max-height: 43vh;
    }

    .search-dropdown::-webkit-scrollbar {
        width: 6px;
    }

    .search-item__cover-wrap,
    .search-item__cover {
        width: 48px;
        height: 48px;
    }

    .search-item__cover-spinner {
        width: 22px;
        height: 22px;
    }

    .search-item__nickname,
    .search-item__nickname-sep,
    .search-item__tag {
        font-size: 1rem;
    }

    .search-item__link {
        gap: 10px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .search-form__input {
        font-size: 1em;
        padding: 14px;
    }

    .search-item__cover-wrap,
    .search-item__cover {
        width: 40px;
        height: 40px;
    }

    .search-item__cover-spinner {
        width: 18px;
        height: 18px;
    }

    .search-item__nickname,
    .search-item__nickname-sep,
    .search-item__tag {
        font-size: 0.9rem;
    }

    .search-item__link {
        gap: 8px;
        padding: 7px 10px;
    }

    .search-dropdown__status {
        font-size: 1rem;
    }

    .search-loader {
        width: 33px;
        height: 33px;
    }
}

@media (min-width: 2000px) {
    .search-form__input {
        width: 1400px;
        font-size: 2.4em;
        padding: 28px;
    }

    .search-loader {
        width: 70px;
        height: 70px;
        right: 15px;
    }

    .search-item__cover-wrap,
    .search-item__cover {
        width: 80px;
        height: 80px;
    }

    .search-item__cover-spinner {
        width: 34px;
        height: 34px;
    }

    .search-item__nickname,
    .search-item__nickname-sep,
    .search-item__tag {
        font-size: 1.3rem;
    }
}

@media (min-width: 3000px) {
    .search-loader {
        right: 20px;
    }
}
