@import url("../components/discovery.css");
@import url("../components/blindbox-card.css");
@media(max-width:620px) {
    body.blindbox {
        background: #101012;
    }

    body.blindbox .discovery-page {
        min-height: calc(100dvh - var(--header-mobile-height));
        background: #101012;
    }

    body.blindbox .discovery-card {
        border: 0;
        background: #17171a;
        box-shadow: none;
    }

    body.blindbox .blindbox-card .discovery-card-body {
        display: none;
    }

    body.blindbox .discovery-empty {
        border: 0;
        background: #232329;
        color: #eee;
    }

}

@media(max-width:1024px) {
    body.blindbox, body.blindbox .page-main {
        background: #000;
    }

    body.blindbox .discovery-page {
        min-height: calc(100dvh - var(--nav-tab-height));
        background: #000;
    }

}

@media(max-width:620px) {
    body.blindbox .discovery-page {
        padding-top: 0;
    }

    body.blindbox .discovery-heading {
        display: none;
    }

    body.blindbox .discovery-card {
        background: #000;
    }

    body.blindbox .discovery-empty {
        background: #151515;
    }

}

.blindbox-card[role=button] {
    cursor: pointer;
}

.blindbox-card:focus-visible {
    outline: 3px solid #00bdbd;
    outline-offset: 3px;
}

.blindbox-refresh-status {
    text-align: center;
    color: #888;
    font-size: 13px;
    margin: 20px 0 8px;
}

.blindbox-refresh-button {
    display: block;
    margin: auto;
    border: 1px solid #c9e6e3;
    border-radius: 12px;
    background: #fff;
    padding: 8px 20px;
    color: #008f91;
}

/* Lightbox: compact preview, full profile and authorized selfie. */
.blindbox-preview {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(440px,90vw);
    max-height: calc(100dvh - 32px);
    overflow: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 24px;
    background: #101014;
    color: #fff;
    padding: 28px 24px 24px;
    box-sizing: border-box;
}

@media(min-width:1025px) {
    .blindbox-preview[data-view=preview] {
        width: min(440px,90vw,calc(75dvh - 180px));
    }
}
.blindbox-preview::backdrop { background: #000c; }
.blindbox-preview [hidden] { display: none !important; }
.box-title { display: flex; align-items: center; gap: 12px; }
.box-title h2 { flex: 1; margin: 8px 0 16px; padding: 12px 16px 12px 28px; background: url('/assets/images/pages/blindbox/title.png') center / 100% 100% no-repeat; font-size: 17px; line-height: 1.5; }
.box-title > span { font-size: 32px; color: #ec3c85; }
.box-title > span img { display: block; width: 44px; height: 44px; object-fit: contain; }
.box-close img { display: block; width: 22px; height: 22px; margin: auto; object-fit: contain; }
.box-close { position: absolute; right: 8px; top: 8px; border: 1px solid #ffffff30; background: #25252d; color: white; border-radius: 50%; width: 32px; height: 32px; font-size: 26px; cursor: pointer; }
.box-counter { margin: 0; font-size: 12px; color: #ccc; }
.box-photo { position: relative; aspect-ratio: 3/4; overflow: hidden; border-radius: 24px; touch-action: pan-y; }
.box-photo > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.box-photo > .box-wave { position: absolute; right: 12px; bottom: 14px; width: 52px; height: 52px; object-fit: contain; }
.box-photo-top { position: absolute; top: 14px; left: 14px; right: 14px; }
.box-photo-top p,.box-photo-details p { width: fit-content; max-width: 100%; padding: 6px 10px; margin: 0 0 6px; border-radius: 20px; background: #8854dacb; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.box-photo-top p:empty,.box-photo-details p:empty { display: none; }
.box-photo-top p:last-child { background: #3295d4d9; }
.box-photo-top p:first-child { background: #ab35bbdc; }
.box-photo-details { position: absolute; inset: auto 0 0; padding: 14px; padding-top: 45px; background: linear-gradient(transparent,#0008); }
.box-photo-details p { background: #ab35bbdc; }
.box-photo-details { padding-right: 68px; }
.box-preview-actions,.box-detail-actions { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.box-preview-actions button { border: 1px solid #ffffff40; border-radius: 50%; background: #111c; color: white; width: 42px; height: 42px; font-size: 26px; cursor: pointer; flex-shrink: 0; }
.box-preview-actions [data-box-share] { font-size: 17px; }
.box-preview-actions [data-box-share] img { display: block; width: 100%; height: 100%; object-fit: contain; }
.blindbox-preview [data-box-status] > img { display: inline-block; width: 38px; height: 24px; margin-right: 8px; object-fit: contain; vertical-align: middle; }
.box-preview-actions a,.box-detail-actions button { flex: 1; text-align: center; border: 0; border-radius: 28px; background: #ab35bb; color: white; padding: 14px; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.blindbox-preview [data-box-status] { margin-top: 12px; font-size: 13px; text-align: center; }
.blindbox-preview [data-box-status]:empty { display: none; }
.box-profile { padding: 24px; background: white; color: #26252a; border-radius: 24px; }
.box-profile h3 { margin: 0 0 16px; }
.box-profile [data-box-profile-tags] { display: flex; flex-wrap: wrap; gap: 8px; }
.box-profile [data-box-profile-tags] span { padding: 6px 12px; border-radius: 20px; color: white; background: #ab35bb; }
.box-profile [data-box-profile-tags] span:nth-child(3n+2) { background: #8854da; }
.box-profile [data-box-profile-tags] span:nth-child(3n) { background: #3295d4; }
.box-profile p { margin: 14px 0; line-height: 1.7; font-size: 14px; overflow-wrap: anywhere; }
.box-profile p:empty { display: none; }
.box-profile [data-box-profile-hobbies],.box-profile [data-box-nature],.box-profile [data-box-criterion],.box-profile [data-box-slogan] {
    width: fit-content;
    max-width: 100%;
    padding: 6px 12px;
    border-radius: 18px;
    background: #5c5c60;
    color: white;
}
.box-profile [data-box-nature] { background: #8854da; }
.box-profile [data-box-slogan] { background: #e55b89; }
.box-profile [data-box-score] { color: #ab35bb; }
.box-profile [data-box-score] img { display: inline-block; width: 20px; height: 20px; margin-left: 5px; object-fit: contain; vertical-align: middle; }
.box-fans { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #eee; }
.box-fans > div { display: flex; flex-wrap: wrap; gap: 5px; }
.box-fans img { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.box-photo-nav { position: absolute; bottom: 12px; left: 14px; right: 14px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.box-photo-nav button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #0009; color: white; font-size: 24px; cursor: pointer; }
.box-photo-nav span { padding: 5px 10px; background: #0009; border-radius: 16px; font-size: 12px; }
.blindbox-preview[data-view=detail] .box-photo-details,.blindbox-preview[data-view=detail] .box-photo-top p:not(:last-child),.blindbox-preview[data-view=detail] .box-wave { display: none; }
.blindbox-preview[data-view=detail] .box-photo-top { top: auto; bottom: 50px; }
.blindbox-preview[data-view=detail] .box-photo-top p:last-child { background: #000b; }
.box-photo-top [data-box-city] img { display: inline-block; width: 14px; height: 16px; object-fit: contain; margin-right: 6px; vertical-align: middle; }
.blindbox-preview[data-view=detail] { width: min(940px,94vw); background: #101014; }
.blindbox-preview[data-view=detail] .box-lightbox-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
.blindbox-preview[data-view=detail] .box-photo { max-height: 65dvh; }
.blindbox-preview[data-view=detail] .box-title { display: none; }
.box-real-preview { position: absolute; inset: 0; z-index: 2; min-height: 100%; padding: 42px 16px 24px; background: #000; text-align: center; overflow: auto; }
.box-real-preview button { position: absolute; top: 8px; left: 12px; background: transparent; border: 0; color: white; font-size: 32px; cursor: pointer; }
.box-real-preview p { margin: 12px auto; padding: 8px 14px; width: fit-content; max-width: 100%; border: 1px solid #fff; border-radius: 24px; }
.box-real-preview figure { position: relative; margin: 0; }
.box-real-preview img { display: block; max-width: 100%; max-height: 66dvh; margin: auto; object-fit: contain; }
.box-real-preview button img { width: 24px; height: 24px; }
.box-real-preview p:has(.box-selfie-caption) { width: min(360px,100%); padding: 0; border: 0; border-radius: 0; }
.box-real-preview .box-selfie-caption { width: 100%; height: auto; }
.box-real-preview figcaption { position: absolute; bottom: 12px; left: 12px; color: #fff; text-shadow: 0 1px 3px #000; }
.blindbox-preview button:focus-visible,.blindbox-preview a:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
body:has(.blindbox-preview[open]) { overflow: hidden; }
@media(max-width:1024px) {
    .blindbox-preview { width: min(440px,92vw); padding: 28px 12px 16px; }
    .box-photo { max-height: 65dvh; }
    .blindbox-preview[data-view=detail] { width: 100vw; height: 100dvh; max-height: 100dvh; max-width: 100vw; margin: 0; padding: max(36px,env(safe-area-inset-top)) 12px max(20px,env(safe-area-inset-bottom)); border-radius: 0; }
    .blindbox-preview[data-view=detail] .box-lightbox-layout { display: block; }
    .blindbox-preview[data-view=detail] .box-photo { border-radius: 0; max-height: none; height: 58dvh; }
    .blindbox-preview[data-view=detail] .box-profile { position: relative; margin-top: -12px; padding: 20px 16px; }
    .blindbox-preview[data-view=detail] .box-profile h3 { display: none; }
    .blindbox-preview[data-view=detail] .box-close { position: fixed; top: max(8px,env(safe-area-inset-top)); right: 12px; z-index: 1; }
    .box-real-preview { position: fixed; height: 100dvh; padding-top: max(50px,env(safe-area-inset-top)); }
    .box-real-preview img { max-height: 70dvh; }
}

.blindbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    min-height: 48px;
}

.blindbox-toolbar a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #30323b;
    font-weight: 600;
}

.blindbox-toolbar a[aria-current] {
    color: #00bdbd;
}

.blindbox-toolbar i {
    font-size: 22px;
}

.blindbox-toolbar a:last-child i {
    color: #6d9aff;
}

.blindbox-tool-description,
.blindbox-toolbar .blindbox-tool-arrow,
.blindbox-feed-heading {
    display: none;
}

@media(min-width:1025px) {
    .blindbox-intro {
        display: grid;
        grid-template-columns: minmax(0,1fr) minmax(290px,.65fr);
        align-items: center;
        gap: 2rem;
        margin-bottom: 2rem;
        padding: 2rem;
        border: 1px solid var(--color-border);
        border-radius: 24px;
        background: radial-gradient(ellipse at top left,var(--color-brand-surface-secondary),transparent 75%),var(--color-bg-card);
    }

    .blindbox-intro .discovery-heading {
        order: -1;
        margin: 0;
        text-align: left;
    }

    .blindbox-intro .editorial-kicker {
        margin: 0;
        color: var(--color-brand-action);
        font-size: .8rem;
        font-weight: 600;
        letter-spacing: .08em;
    }

    .blindbox-intro .discovery-heading h1 {
        margin: .8rem 0;
        color: var(--color-brand-heading);
        font-size: clamp(1.6rem,2.5vw,2.2rem);
        font-weight: 700;
        line-height: 1.4;
    }

    .blindbox-intro .discovery-heading > p:last-child {
        margin: 0;
        color: var(--color-brand-description);
        font-size: .9rem;
    }

    .blindbox-intro .blindbox-toolbar {
        display: grid;
        grid-template-columns: minmax(0,1fr);
        justify-content: stretch;
        gap: .75rem;
        margin: 0;
    }

    .blindbox-intro .blindbox-toolbar a {
        gap: .9rem;
        padding: 1rem;
        border: 1px solid var(--color-border);
        border-radius: 16px;
        background: var(--color-bg-card);
        transition: border-color .2s ease,box-shadow .2s ease;
    }

    .blindbox-intro .blindbox-toolbar a:hover {
        border-color: var(--color-primary);
        box-shadow: 0 4px 16px rgba(22,56,50,.07);
    }

    .blindbox-intro .blindbox-toolbar a:focus-visible {
        outline: 3px solid var(--color-brand-action);
        outline-offset: 3px;
    }

    .blindbox-intro .blindbox-toolbar a > i:first-child {
        display: grid;
        place-items: center;
        flex: 0 0 42px;
        height: 42px;
        border-radius: 13px;
        background: var(--color-brand-surface-secondary);
        color: var(--color-brand-heading);
        font-size: 1.15rem;
    }

    .blindbox-intro .blindbox-toolbar a:last-child > i:first-child {
        background: var(--color-brand-surface-soft);
        color: var(--color-brand-action);
    }

    .blindbox-intro .blindbox-tool-copy {
        display: grid;
        gap: .3rem;
        flex: 1;
        min-width: 0;
        color: var(--color-brand-heading);
        font-size: .9rem;
    }

    .blindbox-intro .blindbox-tool-description {
        display: block;
        color: var(--color-brand-description);
        font-size: .75rem;
        font-weight: 400;
        line-height: 1.5;
    }

    .blindbox-intro .blindbox-toolbar .blindbox-tool-arrow {
        display: block;
        color: var(--color-text-tertiary);
        font-size: .7rem;
    }

    .blindbox-feed-heading {
        display: flex;
        align-items: baseline;
        gap: .9rem;
        margin-bottom: 1.1rem;
    }

    .blindbox-feed-heading h2 {
        margin: 0;
        color: var(--color-brand-heading);
        font-size: 1.1rem;
        font-weight: 600;
    }

    .blindbox-feed-heading p {
        margin: 0;
        color: var(--color-text-tertiary);
        font-size: .8rem;
    }
}

.blindbox-location-prompt {
    display: grid;
    grid-template-columns: 66px minmax(0,1fr) auto;
    grid-template-areas: "icon copy action" "icon status status";
    align-items: center;
    gap: 9px 18px;
    width: min(880px,100%);
    box-sizing: border-box;
    margin: clamp(2rem,7vh,5rem) auto;
    padding: 28px 32px;
    border: 1px solid #e8e1fa;
    border-radius: 22px;
    background: radial-gradient(ellipse at 0 0,#f3edff 0,transparent 52%),linear-gradient(120deg,#fff,#fcfaff);
    box-shadow: 0 16px 44px rgba(57,36,89,.08);
    color: #3c3452;
}

.blindbox-location-icon { grid-area: icon; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; background: #f0eaff; color: #8061c7; font-size: 1.5rem; }
.blindbox-location-copy { grid-area: copy; }
.blindbox-location-copy h1 { margin: 0; color: #382c57; font-size: 1.2rem; }
.blindbox-location-copy p { margin: 5px 0 0; color: #817996; font-size: .88rem; line-height: 1.6; }
.blindbox-location-prompt button { grid-area: action; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; padding: 0 18px; border: 0; border-radius: 13px; background: #7958c8; color: white; font-size: .88rem; font-weight: 600; cursor: pointer; transition: transform .18s ease,box-shadow .18s ease; }
.blindbox-location-prompt button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 18px #7958c833; }
.blindbox-location-prompt button:disabled { opacity: .65; cursor: wait; }
.blindbox-location-status { grid-area: status; margin: 0; color: #928aa3; font-size: .76rem; }
.blindbox-location-status:empty { display: none; }
.blindbox-nearby-pending { display: none; }

@media(max-width:1024px) {
    body.blindbox_nearby .discovery-page { padding: .7rem .85rem 1.5rem; }
    .blindbox-location-prompt { grid-template-columns: 42px minmax(0,1fr); grid-template-areas: "icon copy" "icon action" "status status"; gap: 8px 12px; width: 100%; margin: .5rem 0 1rem; padding: 16px 14px; border-radius: 17px; background: linear-gradient(135deg,#f6f2ff,#fff 82%); box-shadow: 0 5px 18px rgba(57,36,89,.05); }
    .blindbox-location-icon { width: 40px; height: 40px; border-radius: 14px; font-size: 1.05rem; }
    .blindbox-location-copy h1 { font-size: .98rem; }
    .blindbox-location-copy p { font-size: .77rem; line-height: 1.55; }
    .blindbox-location-prompt button { justify-self: stretch; min-height: 40px; padding: 0 12px; font-size: .85rem; }
    .blindbox-location-status { font-size: .72rem; }
}

@media(max-width:1024px) {
    .blindbox-toolbar a {
        color: white;
        font-size: 15px;
    }

    .blindbox-toolbar {
        margin-bottom: 12px;
    }

}

.blindbox-create-entry {
    position: fixed;
    z-index: 20;
    bottom: 100px;
    right: 30px;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 0;
    background: transparent;
    text-decoration: none;
}

.blindbox-create-entry img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.blindbox-create-entry:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
}

@media(max-width:1024px) {
    .blindbox-create-entry {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: calc(var(--nav-tab-height) + env(safe-area-inset-bottom) + 18px);
    }

}

/* Nearby authorization page composition */
.blindbox-nearby-awaiting-location { display: flex; flex-direction: column; min-height: min(68vh, 680px); }
.blindbox-nearby-awaiting-location .blindbox-location-prompt { margin: auto; }
@media (max-width: 1024px) {
    body.blindbox_nearby, body.blindbox_nearby .page-main { background: #f5f4f8; }
    body.blindbox_nearby .page-main { min-height: 100dvh; }
    .blindbox-nearby-page { box-sizing: border-box; min-height: calc(100dvh - 72px); padding: 0 18px 30px; }
    .blindbox-nearby-page .nearby-mobile-heading { margin: 0 -2px 10px; color: #352d49; }
    .blindbox-nearby-page .nearby-mobile-heading a { color: #554779; }
    .blindbox-nearby-awaiting-location .blindbox-location-prompt {
        grid-template-columns: minmax(0,1fr); grid-template-areas: "icon" "copy" "action" "status";
        justify-items: center; gap: 14px; width: 100%; max-width: 480px; margin: auto auto 0; padding: 28px 22px 24px;
        border: 1px solid #e9e3f3; border-radius: 24px; background: radial-gradient(ellipse at 50% 0,#f1eaff 0,transparent 62%),#fff;
        box-shadow: 0 16px 38px rgba(57,36,89,.08); text-align: center;
    }
    .blindbox-nearby-page .blindbox-location-icon { width: 62px; height: 62px; border-radius: 21px; font-size: 1.5rem; }
    .blindbox-nearby-page .blindbox-location-copy h1 { font-size: 1.14rem; }
    .blindbox-nearby-page .blindbox-location-copy p { max-width: 290px; margin-top: 5px; font-size: .88rem; line-height: 1.7; }
    .blindbox-nearby-page .blindbox-location-prompt button { width: 100%; max-width: 320px; min-height: 48px; border-radius: 14px; font-size: .94rem; }
    .blindbox-nearby-page .blindbox-location-status { font-size: .76rem; }
}
@media (max-width: 380px) {
    .blindbox-nearby-page { padding-right: 14px; padding-left: 14px; }
    .blindbox-nearby-awaiting-location .blindbox-location-prompt { padding: 24px 18px 21px; }
}
/* Keep blindbox nearby and history screens in the same light discovery shell as Find People. */
.blindbox-nearby-page { background: #f3f6f5; }
.blindbox-nearby-page > .discovery-empty,
.blindbox-nearby-awaiting-location > .blindbox-refresh-status,
.blindbox-nearby-awaiting-location > .blindbox-refresh-button { display: none; }
.blindbox-nearby-page .blindbox-location-prompt { color: var(--color-brand-heading); }
.blindbox-nearby-page .blindbox-location-copy h1 { color: var(--color-brand-heading); }
.blindbox-nearby-page .blindbox-location-copy p { color: var(--color-brand-description); }
.blindbox-history-page .blindbox-back-link,
.blindbox-nearby-page .blindbox-back-link { display: none; }
.blindbox-history-page .blindbox-subintro { display: grid; grid-template-columns: minmax(0,1fr) minmax(270px,.72fr); align-items: center; gap: 24px; margin-bottom: 24px; padding: 28px; border: 1px solid var(--color-border); border-radius: 22px; background: linear-gradient(120deg,#fff,#faf9fd); }
.blindbox-history-page .discovery-heading { order: -1; margin: 0; text-align: left; }
.blindbox-history-page .blindbox-toolbar { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; margin: 0; }
.blindbox-history-page .blindbox-toolbar > a { min-height: 54px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 14px; background: #fff; color: var(--color-brand-heading); }
@media (max-width: 1024px) {
    .blindbox-nearby-page, .blindbox-history-page { min-height: calc(100dvh - var(--header-mobile-height) - var(--nav-tab-height)); padding: 0 18px calc(var(--nav-tab-height) + 24px); background: #f3f6f5; }
    body.blindbox:has(.blindbox-nearby-page), body.blindbox:has(.blindbox-nearby-page) .page-main,
    body.blindbox:has(.blindbox-history-page), body.blindbox:has(.blindbox-history-page) .page-main { background: #f3f6f5; }
    body.blindbox:has(.blindbox-nearby-page) .blindbox-nearby-page,
    body.blindbox:has(.blindbox-history-page) .blindbox-history-page { background: #f3f6f5; }
    body.blindbox:has(.blindbox-nearby-page) .discovery-card,
    body.blindbox:has(.blindbox-history-page) .discovery-card { background: #fff; }
    body.blindbox:has(.blindbox-nearby-page) .discovery-empty,
    body.blindbox:has(.blindbox-history-page) .discovery-empty { border: 1px solid #e7ecea; background: #fff; color: #53615e; }
    .blindbox-history-page .blindbox-subintro { display: block; margin: 0 0 14px; padding: 0; border: 0; background: transparent; }
    .blindbox-history-page .discovery-heading { display: none; }
    .blindbox-history-page .blindbox-toolbar { display: flex; justify-content: center; gap: 12px; margin: 0; }
    .blindbox-history-page .blindbox-toolbar > a { flex: 1; justify-content: center; min-height: 44px; padding: 8px 12px; border-color: #e3e9e7; background: #fff; color: #35514e; font-size: .85rem; }
    .blindbox-history-page .blindbox-toolbar > a[aria-current] { border-color: #b9e8dd; background: #e8f8f3; color: #008d80; }
    .blindbox-history-page .blindbox-toolbar i { font-size: 1rem; }
}
@media (max-width: 620px) {
    .blindbox-nearby-page, .blindbox-history-page { padding-right: 14px; padding-left: 14px; }
    body.blindbox:has(.blindbox-nearby-page) .discovery-card,
    body.blindbox:has(.blindbox-history-page) .discovery-card { border: 1px solid #e9edeb; background: #fff; box-shadow: 0 3px 12px rgba(27,55,50,.05); }
}