/* App mode, the Entdecke tab (find-matches.php, partails/find-matches/matches.php, assets/js/app-discover.js): one card
   filling the space between the top bar and the action row, the next card behind it, the swipe with its stamps, the
   empty state and the filter as a bottom sheet. Phone layout only (up to 675px); wider screens keep the old deck.
   The stamp and the photo text are the mockup's (design/c-swipe.png): light teal and white on the photo. */
.app-discover {--deck-stamp-like:#3be0d0; --deck-stamp-nope:#e6ecf2; --deck-like:0; --deck-nope:0;}
/* Phone-only parts that lay themselves out (flex), so they cannot use .app-only (display:revert). */
.app-deck-actions,.app-deck-empty {display:none;}

@media(max-width:675px) {
 /* The page is one screen: whatever notice sits above (profile incomplete, pending verification) shortens the deck. */
 .member-app.find-matches-page #container > .container.page-margin {display:flex;flex-direction:column;box-sizing:border-box;min-height:calc(100vh - var(--app-top) - var(--app-safe-top) - var(--app-tabs) - var(--app-safe-bottom));min-height:calc(100dvh - var(--app-top) - var(--app-safe-top) - var(--app-tabs) - var(--app-safe-bottom));margin-top:0;margin-bottom:0;padding-top:10px;}
 .member-app.find-matches-page #container > .container.page-margin > .alert,
 .member-app.find-matches-page #container > .container.page-margin > .ui-announcement,
 .member-app.find-matches-page #container > .container.page-margin > .ui-match-profile-notice {flex:none;margin:0 0 10px;}
 /* A long announcement scrolls in itself, so the first profile stays on the screen. */
 .member-app.find-matches-page #container > .container.page-margin > .ui-announcement {max-height:34vh;max-height:34dvh;overflow-y:auto;overscroll-behavior:contain;padding:14px 50px 14px 16px;}
 .member-app #section_match_users.app-discover {display:flex;flex:1 1 auto;flex-direction:column;min-height:0;}
 .app-discover .dt_home_match_user {position:relative;flex:1 1 auto;min-height:300px;max-width:none;margin:0;padding:0;}
 .app-discover .dt_home_match_user .mtc_usr_details {position:absolute;inset:0;width:auto;height:auto;}
 .app-discover .mtc_usr_avtr,.app-discover .mtc_usr_details > .empty_state {display:none !important;}
 .app-discover > .dt_home_match_user[hidden],.app-discover .app-deck-empty[hidden],.app-discover .app-deck-actions[hidden] {display:none !important;}

 /* Cards: only the top one and the one behind it are drawn (smaller, darker, its lower edge just showing); the
    classes come from app-discover.js, which also moves the one behind forward while the top one is dragged away. */
 .app-discover .mtc_usrd_content {display:none !important;position:absolute;inset:0;z-index:1;width:auto;height:auto;border-radius:26px;opacity:1;visibility:visible;pointer-events:none;transform:none;transition:none;will-change:transform;}
 .app-discover .mtc_usrd_content.is-top {display:block !important;z-index:3;pointer-events:auto;touch-action:pan-y;cursor:grab;}
 .app-discover .mtc_usrd_content.is-top.is-dragging {cursor:grabbing;}
 .app-discover .mtc_usrd_content.is-next {display:block !important;z-index:2;transform:translateY(calc(4.4% * (1 - var(--deck-progress,0)))) scale(calc(.94 + .06 * var(--deck-progress,0)));filter:brightness(calc(.55 + .45 * var(--deck-progress,0)));}
 .app-discover .mtc_usrd_content.is-settling {transition:transform .26s var(--app-ease),filter .26s var(--app-ease);}
 .app-discover .mtc_usrd_content.is-leaving {display:block !important;z-index:4;pointer-events:none;}
 .app-discover .mtc_usrd_content > .mtc_usrd_slider,.app-discover .mtc_usrd_content > .mtc_usrd_actions {display:none !important;}

 .app-deck-face {position:absolute;inset:0;overflow:hidden;border-radius:26px;background:var(--app-card);box-shadow:0 14px 40px #00000073;color:#fff;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;}
 .is-top .app-deck-face {box-shadow:0 14px 40px #00000073,0 0 calc(60px * var(--deck-like)) calc(4px * var(--deck-like)) #00aaaa73;}
 .app-deck-photos,.app-deck-photos img {position:absolute;inset:0;width:100%;height:100%;}
 .app-deck-photos img {object-fit:cover;opacity:0;pointer-events:none;-webkit-user-drag:none;}
 .app-deck-photos img.is-shown {opacity:1;}
 /* Legibility at the top (segments) and bottom (name); the swipe tints the photo teal (like) or dark (pass). */
 .app-deck-face::after {content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(180deg,#00000047 0,#0000 16%,#0000 46%,#080e16eb 100%);}
 .app-deck-face::before {content:"";position:absolute;inset:0;z-index:2;pointer-events:none;background:linear-gradient(135deg,#00b3a780,#0697db1f);opacity:var(--deck-like);}
 .app-deck-face .app-deck-photos::after {content:"";position:absolute;inset:0;background:var(--app-night);opacity:calc(.45 * var(--deck-nope));}
 .app-deck-segs {position:absolute;top:10px;left:12px;right:12px;z-index:3;display:flex;gap:5px;}
 .app-deck-segs b {flex:1;height:3.5px;border-radius:2px;background:#ffffff61;}
 .app-deck-segs b.is-on {background:#fff;}
 .app-deck-stamp {position:absolute;top:64px;z-index:3;max-width:calc(100% - 60px);overflow:hidden;padding:4px 12px;border:4px solid;border-radius:12px;background:#00000026;font:800 25px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:.02em;text-transform:uppercase;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;}
 .app-deck-stamp-like {left:18px;color:var(--deck-stamp-like);border-color:var(--deck-stamp-like);transform:rotate(-14deg);transform-origin:left top;opacity:var(--deck-like);}
 .app-deck-stamp-nope {right:18px;color:var(--deck-stamp-nope);border-color:var(--deck-stamp-nope);transform:rotate(14deg);transform-origin:right top;opacity:var(--deck-nope);}
 .app-deck-info {position:absolute;left:0;right:0;bottom:0;z-index:3;display:block;padding:18px;color:#fff !important;text-decoration:none;-webkit-tap-highlight-color:transparent;}
 .app-deck-info h2 {display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:#fff;font:800 30px/1.15 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:-.02em;}
 .app-deck-info h2 small {flex:none;color:#fff;font-weight:500;font-size:26px;}
 .app-deck-name {overflow:hidden;min-width:0;white-space:nowrap;text-overflow:ellipsis;}
 .app-deck-info .app-verified {width:22px;height:22px;}
 .app-deck-info .app-verified svg {width:13px;height:13px;}
 .app-deck-where {display:flex;align-items:center;gap:6px;margin:5px 0 0;font-size:15px;line-height:1.3;opacity:.95;}
 .app-deck-where svg {flex:none;width:16px;height:16px;}
 .app-deck-chips {display:flex;flex-wrap:wrap;gap:7px;max-height:72px;margin-top:11px;overflow:hidden;}
 .app-deck-chips .app-chip {border-color:transparent;background:#ffffff29;color:#fff;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);}
 .app-deck-chips .app-chip.app-chip-same {background:#00b3a7d9;}
 .app-deck-info:focus-visible {outline:3px solid var(--app-teal);outline-offset:-6px;border-radius:0 0 26px 26px;}

 /* Action row: undo, pass, like (the screen's one water-coloured action), chat. */
 .app-deck-actions {display:flex;flex:none;align-items:center;justify-content:center;gap:clamp(12px,5.2vw,22px);padding:14px 0 12px;}
 .app-deck-btn {display:grid;place-items:center;flex:none;box-sizing:border-box;width:62px;height:62px;margin:0;padding:0;border:1px solid var(--app-line);border-radius:50%;background:var(--app-card);color:var(--app-mut);box-shadow:0 6px 18px #0000004d;cursor:pointer;transition:transform .18s var(--app-ease),opacity .18s;-webkit-tap-highlight-color:transparent;}
 .app-deck-btn svg {width:28px;height:28px;pointer-events:none;}
 .app-deck-btn-small {width:50px;height:50px;}
 .app-deck-btn-small svg {width:22px;height:22px;}
 .app-deck-btn-like {width:76px;height:76px;border:0;background:var(--app-water);color:#fff;box-shadow:0 10px 28px #0697db73;transform:scale(calc(1 + .14 * var(--deck-like)));}
 .app-deck-btn-like svg {width:36px;height:36px;}
 .app-deck-btn[data-deck-action="pass"] {transform:scale(calc(1 + .1 * var(--deck-nope)));}
 .app-deck-btn:active:not([disabled]) {transform:scale(.92);}
 .app-deck-btn[disabled] {opacity:.4;cursor:default;box-shadow:none;}
 .app-deck-btn:focus-visible {outline:3px solid var(--app-teal);outline-offset:3px;}

 /* Empty: the illustration, a title, what can be done. */
 .app-discover .app-deck-empty {display:flex;flex:1 1 auto;align-items:center;justify-content:center;}
 .app-discover .app-deck-empty .app-empty {margin:8px auto 16px;}
 .app-discover .app-deck-empty .app-empty img {width:min(100%,300px,36vh);width:min(100%,300px,36dvh);height:auto;}
 @media(max-height:620px) {.app-discover .app-deck-empty .app-empty {gap:6px;margin-top:0;} .app-discover .app-deck-empty .app-empty img {width:min(100%,26vh);width:min(100%,26dvh);} .app-discover .app-deck-empty .app-empty h2 {font-size:21px;} .app-discover .app-deck-empty .app-empty p {font-size:15px;}}
 .app-discover .app-deck-empty .app-btn[hidden] {display:none;}
 .app-deck-loading {position:absolute;inset:0;border-radius:26px;}

 /* The filter is the existing form (Materialize modal, a .bottom-sheet on phones: member-filters.js), presented as a
    bottom sheet: it slides up when shown (.open; an animation, as it was display:none) and back down while it fades. */
 .member-app #filtr_slide_out.ui-match-filters {inset:auto 0 0 !important;width:100%;max-width:520px;max-height:min(88vh,720px);max-height:min(88dvh,720px);margin:0 auto;border:0;border-radius:26px 26px 0 0;background:var(--app-deep) !important;box-shadow:0 -10px 40px #0007;transform:translateY(104%);transition:transform .24s var(--app-ease);}
 .member-app #filtr_slide_out.ui-match-filters.open {transform:none;animation:app-discover-sheet .28s var(--app-ease);}
 .member-app #filtr_slide_out.ui-match-filters::before {content:"";display:block;flex:none;width:44px;height:5px;margin:10px auto 0;border-radius:3px;background:#3a4759;}
 .member-app #filtr_slide_out .ui-filter-header {position:relative;padding:12px 20px 8px;}
 /* Closes with a swipe down, a tap beside it or Back (assets/js/app-shell.js); the cross stays for screen readers
    (the dialog puts the focus on it when it opens, so it is hidden focused or not). */
 .member-app #filtr_slide_out .ui-filter-close {position:absolute;width:1px;height:1px;min-width:0;min-height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);}
 .member-app #filtr_slide_out .ui-filter-actions {padding-bottom:calc(14px + var(--app-safe-bottom));background:var(--app-deep);}
 .member-app #filtr_slide_out .ui-filter-actions .ui-button {min-height:48px;border-radius:24px;}
 .member-app #filtr_slide_out .btn-find-matches-search {border:0;background:var(--app-water);color:#fff;}
 .member-app #nav-logged-in #app-bar-actions > .app-discover-filter.is-active {border-color:var(--app-teal);color:var(--app-teal);}
}

@keyframes app-discover-sheet {from {transform:translateY(104%);}}
@media(max-width:675px) and (prefers-reduced-motion:reduce) {
 .app-discover .mtc_usrd_content.is-settling,.app-deck-btn {transition:none;}
 .member-app #filtr_slide_out.ui-match-filters {transition:none;}
 .member-app #filtr_slide_out.ui-match-filters.open {animation:none;}
}
