/* ==========================
   ACCOUNT SEARCH
========================== */

.explore-main { width: 100%; padding: 0 16px 80px; }
.explore-shell { max-width: 1280px; }
.explore-left-ad, .explore-right-ad { margin-top: 94px; }

.explore-page {
    --surface-radius: 34px;
    width: 100%;
    max-width: 920px;
    min-height: 620px;
    margin: 94px auto 0;
    padding: 50px 52px 58px;
    overflow: visible;
}

.explore-header {
    position: relative;
    z-index: 5;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.explore-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: rgba(20, 20, 20, .5);
}

.explore-header h1 {
    margin: 0 0 12px;
    font-size: clamp(42px, 6vw, 58px);
    line-height: 1.05;
    font-weight: 850;
    letter-spacing: -.05em;
    color: #222;
}

.explore-header > p {
    margin: 0 auto 28px;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(20, 20, 20, .62);
}

.search-wrapper { position: relative; width: 100%; }

.search-form, .search-dropdown {
    background: rgba(255, 255, 255, .48);
    border: 1px solid rgba(255, 255, 255, .48);
    box-shadow: 0 18px 46px rgba(23, 55, 82, .13), inset 0 1px 0 rgba(255, 255, 255, .85);
    backdrop-filter: blur(30px) saturate(1.2);
    -webkit-backdrop-filter: blur(30px) saturate(1.2);
}

.search-form {
    position: relative;
    display: flex;
    padding: 7px;
    border-radius: 999px;
}

.search-form::before {
    content: "";
    position: absolute;
    z-index: 1;
    left: 23px;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(20, 20, 20, .42);
    border-radius: 50%;
    transform: translateY(-58%);
    pointer-events: none;
}

.search-form::after {
    content: "";
    position: absolute;
    z-index: 1;
    left: 37px;
    top: calc(50% + 7px);
    width: 7px;
    height: 2px;
    border-radius: 999px;
    background: rgba(20, 20, 20, .42);
    transform: rotate(45deg);
    pointer-events: none;
}

.search-form input {
    flex: 1;
    min-width: 0;
    padding: 15px 18px 15px 45px;
    border: 0;
    outline: 0;
    border-radius: 999px;
    background: transparent;
    color: #222;
    font: 500 15px/1.2 inherit;
}

.search-form input::placeholder { color: rgba(20, 20, 20, .42); }
.search-form input:focus-visible { box-shadow: 0 0 0 2px rgba(24, 24, 24, .72); }

.search-form button {
    flex: 0 0 auto;
    padding: 13px 26px;
    border: 0;
    border-radius: 999px;
    background: rgba(24, 24, 24, .9);
    color: #fff;
    cursor: pointer;
    font: 850 14px/1 inherit;
    transition: transform .18s ease, background .18s ease;
}

.search-form button:hover { transform: translateY(-1px); background: #181818; }
.search-form button:focus-visible { outline: 2px solid #181818; outline-offset: 3px; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 420px;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    border-radius: 22px;
    list-style: none;
    text-align: left;
}

.search-dropdown[hidden] { display: none; }

.search-option a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
    transition: background .15s ease;
}

.search-option.is-active a, .search-option a:hover { background: rgba(255, 255, 255, .55); }

.search-option img {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 13px;
    background: rgba(255, 255, 255, .3);
}

.option-text { min-width: 0; }
.option-username, .option-meta { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.option-username { font-size: 15px; font-weight: 850; color: #222; }
.option-meta { margin-top: 2px; font-size: 13px; color: rgba(20, 20, 20, .6); }

.search-empty-state {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 54px 20px 20px;
    text-align: center;
}

.search-empty-state[hidden] { display: none; }

.search-empty-icon {
    position: relative;
    width: 62px;
    height: 62px;
    margin-bottom: 20px;
    border: 2px solid rgba(20, 20, 20, .18);
    border-radius: 50%;
}

.search-empty-icon::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 2px;
    right: -16px;
    bottom: 1px;
    border-radius: 999px;
    background: rgba(20, 20, 20, .18);
    transform: rotate(45deg);
    transform-origin: left center;
}

.search-empty-state h2 { margin: 0 0 8px; font-size: 21px; color: rgba(20, 20, 20, .72); }
.search-empty-state p { margin: 0; font-size: 14px; color: rgba(20, 20, 20, .48); }

.explore-section { margin-top: 50px; }
.explore-section h2 { margin: 0 0 22px; font-size: 28px; letter-spacing: -.035em; color: #222; }

.account-results {
    border-top: 1px solid rgba(20, 20, 20, .12);
}

.account-result {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 16px 8px;
    border-bottom: 1px solid rgba(20, 20, 20, .12);
    color: inherit;
    text-decoration: none;
    transition: padding .18s ease, background .18s ease;
}

.account-result:hover {
    padding-inline: 14px;
    background: rgba(255, 255, 255, .22);
}

.account-result:focus-visible {
    outline: 2px solid #181818;
    outline-offset: 2px;
    border-radius: 14px;
}

.account-result-image {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 17px;
    background: rgba(255, 255, 255, .32);
    box-shadow: 0 8px 22px rgba(23, 55, 82, .13);
}

.account-result-identity,
.account-result-stats { min-width: 0; }

.account-result-username,
.account-result-name,
.account-result-rank,
.account-result-comparisons {
    display: block;
}

.account-result-username {
    overflow: hidden;
    font-size: 16px;
    font-weight: 850;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #222;
}

.account-result-name {
    margin-top: 4px;
    overflow: hidden;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: rgba(20, 20, 20, .55);
}

.account-result-rank {
    font-size: 14px;
    font-weight: 850;
    color: rgba(20, 20, 20, .76);
}

.account-result-stats {
    padding-left: 22px;
    text-align: right;
}

.account-result-comparisons {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(20, 20, 20, .46);
}

.account-result-arrow {
    font-size: 20px;
    color: rgba(20, 20, 20, .32);
    transition: transform .18s ease, color .18s ease;
}

.account-result:hover .account-result-arrow {
    color: rgba(20, 20, 20, .72);
    transform: translateX(3px);
}

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.profile-card-link { display: block; min-width: 0; color: inherit; text-decoration: none; }
.profile-card { min-width: 0; }

.profile-image {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 24px;
    background: rgba(255, 255, 255, .32);
    box-shadow: 0 16px 38px rgba(23, 55, 82, .14);
    transition: transform .22s ease, box-shadow .22s ease;
}

.profile-card-link:hover .profile-image { transform: translateY(-3px); box-shadow: 0 21px 44px rgba(23, 55, 82, .2); }
.profile-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

.profile-card h3, .profile-card p {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.profile-card h3 { margin: 0 0 5px; color: #222; font-size: 17px; font-weight: 850; }
.profile-card p { margin: 0 0 5px; color: rgba(20, 20, 20, .58); font-size: 13px; }
.profile-card span { display: inline-block; margin-top: 3px; color: rgba(20, 20, 20, .46); font-size: 12px; font-weight: 750; }

.search-status {
    grid-column: 1 / -1;
    margin: 0;
    padding: 44px 12px;
    text-align: center;
    font-size: 15px;
    color: rgba(20, 20, 20, .58);
}

.search-status.error { color: #a32830; }

@media (max-width: 1400px) {
    .explore-shell.ads-shell { grid-template-columns: minmax(0, 1fr); max-width: 920px; }
    .explore-shell.ads-shell > .side-ad { display: flex; }
}

@media (max-width: 760px) {
    .explore-main { padding: 0 14px 60px; }
    .explore-page { --surface-radius: 26px; margin-top: 90px; padding: 36px 22px 42px; }
    .explore-header h1 { font-size: 38px; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
}

@media (max-width: 500px) {
    .search-form { padding: 6px; }
    .search-form input { padding-right: 12px; }
    .search-form button { padding-inline: 18px; }
    .search-empty-state { min-height: 280px; }

    .account-result {
        grid-template-columns: 52px minmax(0, 1fr) 18px;
        gap: 12px;
        padding-inline: 2px;
    }

    .account-result-image {
        width: 52px;
        height: 52px;
        border-radius: 15px;
    }

    .account-result-stats {
        display: none;
    }
}

/* Phone Search reserves one stable card between two shallow ad shells.
   Existing tablet/desktop rules and the shared ad components stay intact. */
@media (max-width: 600px) {
    .page-explore[data-ad-layout="responsive"] {
        display: flex;
        flex-direction: column;
        height: 100svh;
        min-height: 100svh;
    }

    .page-explore .navbar { flex-shrink: 0; margin-top: 12px; }

    .page-explore[data-ad-layout="responsive"] .responsive-ads-shell {
        flex: 1 0 0;
        /* On exceptionally short views, scroll the page rather than lose the
           header or squeeze the result list below one usable row. */
        min-height: calc(320px + var(--compare-ad-height) * 2 + var(--compare-gap) * 3
            + max(10px, calc(16px - var(--compare-compact-space) * .375), var(--compare-gap)));
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "top" "content" "right";
        grid-template-rows: auto minmax(320px, 1fr) auto;
        align-items: stretch;
        gap: var(--compare-gap);
        padding: var(--compare-gap) var(--mobile-page-gutter)
            max(10px, calc(16px - var(--compare-compact-space) * .375), var(--compare-gap));
    }

    .page-explore .responsive-ads-shell [data-ad-slot="left"],
    .page-explore .explore-page > [data-ad-anchor="middle"] { display: none; }

    .page-explore[data-ad-layout="responsive"] .responsive-ads-shell > :is([data-ad-slot="top"], [data-ad-slot="right"]) {
        position: relative;
        top: auto;
        width: 100%;
        min-height: var(--compare-ad-height);
        padding: var(--compare-ad-mat-padding);
        gap: 0;
        --surface-radius: clamp(12px, 3.5vw, 18px);
        background: #fff;
        border: 1px solid rgba(145, 174, 195, .5);
        box-shadow: 0 2px 6px rgba(24, 70, 105, .055);
        overflow: visible;
    }

    .page-explore .responsive-ad::before,
    .page-explore .responsive-ad::after { content: none; }

    .page-explore .responsive-ad-label {
        font-family: inherit;
        font-size: clamp(9px, 2.4vw, 10px);
    }

    /* Reserve a placeholder minimum, not a cap on a future sized creative.
       Keep all rounding on the decorative shell rather than the actual ad. */
    .page-explore .responsive-ad-creative,
    .page-explore .responsive-ad-creative > ins,
    .page-explore .responsive-ad-creative iframe {
        overflow: visible;
        border-radius: 0;
    }

    .page-explore .responsive-ad-creative:not(:empty) { display: block; width: 100%; }
    .page-explore .responsive-ad:has(> .responsive-ad-creative:not(:empty)) > [data-ad-placeholder] { display: none; }
    .page-explore .responsive-ad-creative :is(img, video, iframe) { max-width: none; }

    .page-explore .responsive-ads-shell .explore-main {
        height: 100%;
        min-height: 0;
        padding: 0;
    }

    .page-explore .responsive-ads-shell .explore-page {
        --surface-radius: clamp(22px, 6vw, 30px);
        display: flex;
        flex-direction: column;
        gap: var(--compare-section-gap);
        height: 100%;
        min-height: 0;
        margin: 0 auto;
        padding: var(--compare-card-padding);
        overflow: hidden;
    }

    .page-explore .explore-header { flex-shrink: 0; width: 100%; }

    .page-explore .explore-eyebrow {
        margin-bottom: var(--compare-control-gap);
        font-size: clamp(10px, 2.5vw, 12px);
        line-height: 1.3;
    }

    .page-explore .explore-header h1 {
        margin-bottom: var(--compare-control-gap);
        font-size: clamp(34px, 8vw, 38px);
    }

    .page-explore .explore-header > p {
        margin-bottom: var(--compare-section-gap);
        font-size: clamp(16px, 3.8vw, 18px);
        line-height: 1.3;
    }

    .page-explore .search-form {
        height: clamp(58px, 14vw, 64px);
        padding: 6px;
    }

    .page-explore .search-form input {
        height: 100%;
        padding: 8px 10px 8px 45px;
        font-family: inherit;
        font-size: 16px;
        line-height: 1.2;
    }

    .page-explore .search-empty-state {
        flex: 1 1 0;
        min-height: 0;
        justify-content: flex-start;
        padding: var(--compare-section-gap) 0 0;
        overflow-y: auto;
    }

    .page-explore .search-empty-icon { width: 36px; height: 36px; margin-bottom: 12px; }
    .page-explore .search-empty-icon::after { width: 16px; right: -11px; }
    .page-explore .search-empty-state h2 { margin-bottom: 6px; font-size: 18px; }
    .page-explore .search-empty-state p { line-height: 1.35; }
    .page-explore #search-results-section:not([hidden]) {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
        margin-top: 0;
    }

    .page-explore .explore-section h2 { flex-shrink: 0; margin-bottom: var(--compare-control-gap); font-size: 22px; }
    .page-explore .account-results {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    .page-explore .search-status { padding: 18px 4px; }
}
