/* ==========================================================================
   Discover / Swipe UI Styles
   ========================================================================== */

/* Layout */
.hh-discover {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100svh - 120px);
    gap: 0.85rem;
    /* The shell owns scrolling. Avoid clipping cards/actions at short landscape
       heights, browser zoom, or large text settings. */
    height: auto;
    max-height: none;
    padding: 0.72rem;
    width: 100%;
    overflow: visible;
}

.hh-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 60vh;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--hh-text-secondary);
}

.hh-loading h3 {
    margin: 0;
    color: var(--hh-text-primary);
}

.hh-loading p {
    margin: 0;
}

.hh-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(var(--hh-primary-rgb), 0.2);
    border-top-color: var(--hh-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Empty State */
.hh-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 400px;
    margin: 0 auto;
}

.hh-batch-complete-state {
    max-width: 460px;
}

.hh-post-batch-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
    width: 100%;
}

.hh-post-batch-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.hh-batch-complete-state > .hh-action-status,
.hh-card-stack > .hh-action-status {
    width: 100%;
    margin-top: 0.75rem;
}

.hh-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--hh-accent);
}

.hh-discover-guide {
    width: 100%;
    max-width: 100%;
    margin: 0.2rem auto 0.6rem;
    padding: 0.62rem 0.72rem;
    border: 1px solid rgba(var(--hh-security-rgb), 0.28);
    background: var(--hh-surface-soft);
}

.hh-discover-guide-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--hh-text-primary);
}

.hh-discover-guide-head span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.hh-discover-guide-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 999px;
    border: 1px solid var(--hh-glass-border);
    background: transparent;
    color: var(--hh-text-secondary);
    cursor: pointer;
}

.hh-discover-guide ul {
    margin: 0.6rem 0 0;
    padding-left: 1.1rem;
    color: var(--hh-text-secondary);
    font-size: 0.79rem;
}

.hh-discover-guide li + li {
    margin-top: 0.38rem;
}

.hh-discover-guide p {
    margin: 0.55rem 0 0;
    color: var(--hh-text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* Card Stack */
.hh-card-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    position: relative;
    margin: 0 auto;
    height: auto;
    flex: 0 0 auto;
    min-height: min(38rem, calc(100svh - 10rem));
    overflow: visible;
}

.hh-profile-card {
    width: 100%;
    border-radius: var(--hh-radius-xl);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s ease;
    background: var(--hh-dark-surface);
    position: relative;
    box-shadow: var(--hh-shadow-lg);
    border: 1px solid var(--hh-glass-border);
    flex: 0 0 auto;
    min-height: clamp(24rem, calc(100svh - 18rem), 38rem);
    display: flex;
    flex-direction: column;
}

.hh-profile-card.swipe-left {
    transform: translateX(-150%) rotate(-15deg);
    opacity: 0;
}

.hh-profile-card.swipe-right {
    transform: translateX(150%) rotate(15deg);
    opacity: 0;
}

/* Card entrance animation */
@keyframes cardEnter {
    from {
        transform: scale(0.92);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hh-profile-card.card-entering {
    animation: cardEnter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* MAUI iOS WKWebView can replay opacity keyframes and cause a visible double-fade blink. */
html.hh-platform-ios .hh-profile-card.card-entering {
    animation: none;
}

/* Swipe gesture indicator overlays */
.hh-swipe-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    z-index: var(--hh-z-sticky);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 24px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.hh-swipe-indicator.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.hh-swipe-like {
    right: 16px;
    background: rgba(var(--hh-success-rgb), 0.2);
    border: 3px solid var(--hh-success);
    color: var(--hh-success);
}

.hh-swipe-pass {
    left: 16px;
    background: rgba(var(--hh-danger-rgb), 0.2);
    border: 3px solid var(--hh-danger);
    color: var(--hh-danger);
}

/* Undo button */
.hh-undo-btn {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    background: var(--hh-dark-elevated) !important;
    border: 2px solid var(--hh-glass-border) !important;
    color: var(--hh-warning) !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.hh-undo-btn:hover:not([disabled]) {
    background: rgba(var(--hh-warning-rgb), 0.15) !important;
    border-color: var(--hh-warning) !important;
    transform: scale(1.1);
}

/* Card three-dot menu */
.hh-card-menu-trigger {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: var(--hh-z-card-overlay);
}

.hh-card-menu-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: var(--hh-text-inverse);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease;
}

.hh-card-menu-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.hh-card-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--hh-dark-surface);
    border: 1px solid var(--hh-glass-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--hh-shadow-lg);
    min-width: 160px;
    animation: cardEnter 0.15s ease;
}

.hh-card-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    min-height: 44px;
    background: none;
    border: none;
    color: var(--hh-text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.hh-card-menu button:hover {
    background: var(--hh-dark-elevated);
}

.hh-card-menu button:last-child {
    color: var(--hh-danger);
}

/* Report dialog */
.hh-report-dialog {
    max-width: 380px;
}

.hh-report-reasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    width: 100%;
}

.hh-report-reason-btn {
    padding: 12px 16px;
    min-height: 48px;
    border-radius: 10px;
    background: var(--hh-dark-elevated);
    border: 2px solid var(--hh-glass-border);
    color: var(--hh-text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    text-align: left;
}

.hh-report-reason-btn:hover {
    background: rgba(var(--hh-primary-rgb), 0.1);
    border-color: rgba(var(--hh-primary-rgb), 0.3);
}

.hh-report-reason-btn.selected {
    background: rgba(var(--hh-primary-rgb), 0.15);
    border-color: var(--hh-primary);
    color: var(--hh-primary);
}

/* Block dialog */
.hh-block-dialog {
    max-width: 340px;
}

/* Danger button variant */
.hh-danger-btn {
    background: var(--hh-danger) !important;
}

.hh-danger-btn:hover:not([disabled]) {
    background: var(--hh-danger) !important;
    filter: brightness(0.85);
}

/* Touch action to prevent browser scroll during swipe */
.hh-card-stack {
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.hh-profile-card {
    touch-action: none;
    user-select: none;
}

.hh-profile-image-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    background: var(--hh-dark-elevated);
    overflow: hidden;
}

.hh-profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hh-profile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    color: var(--hh-text-muted);
    background: rgba(var(--hh-primary-rgb), 0.08);
}

.hh-blind-picture-lock {
    flex-direction: column;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
    font-size: 0.95rem;
    background:
        radial-gradient(circle at 50% 35%, rgba(var(--hh-secondary-rgb), 0.2), transparent 45%),
        rgba(var(--hh-primary-rgb), 0.08);
}

.hh-blind-picture-lock strong {
    color: var(--hh-text-primary);
    font-size: 1.1rem;
}

.hh-blind-picture-lock span {
    max-width: 22rem;
    color: var(--hh-text-secondary);
    line-height: 1.5;
}

.hh-profile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3.5rem 1rem 0.85rem;
    background: linear-gradient(to top, rgba(15, 15, 19, 0.95) 0%, rgba(15, 15, 19, 0.8) 40%, transparent 100%);
}

.hh-profile-info {
    color: var(--hh-text-inverse);
}

.hh-profile-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.hh-profile-age {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--hh-text-secondary);
}

.hh-profile-location {
    font-size: 0.84rem;
    color: var(--hh-text-secondary);
    margin: 0.25rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Compatibility Score Badge */
.hh-compat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--hh-radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--hh-success);
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hh-compat-badge .mud-icon-root {
    font-size: 0.875rem;
    color: inherit;
}

@keyframes badgePop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Personality Tags on Discovery & EditProfile */
.hh-personality-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hh-glass-border);
}

.hh-personality-chip {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: var(--hh-radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(var(--hh-secondary-rgb), 0.12);
    color: var(--hh-secondary);
    border: 1px solid rgba(var(--hh-secondary-rgb, 130, 100, 255), 0.2);
    letter-spacing: 0.02em;
}

/* Voice Profile Section on EditProfile */
.hh-voice-profile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background: var(--hh-surface-soft);
    border: 1px solid var(--hh-glass-border);
    border-radius: var(--hh-radius-xl);
}

.hh-voice-profile-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.hh-voice-profile-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.hh-voice-profile-header p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.7;
}

.hh-voice-profile-icon {
    background: rgba(var(--hh-warning-rgb), 0.12);
    padding: 0.625rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hh-voice-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hh-voice-profile .btn-secondary,
.hh-voice-profile .btn-primary {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Wingman CTA Banner on Matches */
.hh-wingman-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    background: rgba(255, 180, 0, 0.06);
    border: 1px solid rgba(255, 180, 0, 0.15);
    border-radius: var(--hh-radius-xl);
    gap: 1rem;
}

.hh-wingman-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hh-wingman-banner-text h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: hsl(38, 95%, 65%);
}

.hh-wingman-banner-text p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.7;
}

.hh-wingman-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    min-height: 44px;
    border-radius: var(--hh-radius-full);
    border: 1px solid rgba(255, 180, 0, 0.3);
    background: rgba(255, 180, 0, 0.12);
    color: hsl(38, 95%, 65%);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.hh-wingman-banner-btn:hover {
    background: rgba(255, 180, 0, 0.2);
    transform: translateY(-1px);
}

/* Debrief Button in Match Actions */
.hh-action-btn.debrief {
    background: rgba(100, 180, 255, 0.1);
    border-color: rgba(100, 180, 255, 0.25);
    color: hsl(210, 90%, 70%);
}

.hh-action-btn.debrief:hover {
    background: rgba(100, 180, 255, 0.2);
    transform: translateY(-2px);
}

/* Wingman Card Accent on Home */
.hh-wingman-card {
    border-left: 3px solid hsl(38, 95%, 55%);
}


.hh-profile-details {
    padding: 1.5rem;
    background: var(--hh-dark-surface);
    border-top: 1px solid var(--hh-glass-border);
}

.hh-profile-bio {
    font-size: 0.9375rem;
    color: var(--hh-text-secondary);
    margin: 0 0 1rem;
    line-height: 1.6;
}

.hh-profile-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hh-interest-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--hh-glass-border);
    padding: 0.375rem 0.75rem;
    border-radius: var(--hh-radius-full);
    font-size: 0.8125rem;
    color: var(--hh-text-primary);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.hh-interest-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--hh-primary);
}

/* Swipe Actions */
.hh-swipe-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 0 0.5rem;
    flex-shrink: 0;
}

.hh-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--hh-shadow-md);
}

.hh-action-btn:focus-visible,
.hh-card-menu-btn:focus-visible,
.hh-card-menu button:focus-visible,
.hh-discover-guide-close:focus-visible,
.hh-discover-safety-nudge-dismiss:focus-visible,
.hh-quality-btn:focus-visible {
    outline: 2px solid var(--hh-accent);
    outline-offset: 2px;
}

.hh-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Cooldown state — progress ring overlay on action buttons */
.hh-action-btn.cooldown {
    opacity: 0.6;
    position: relative;
}

.hh-cooldown-ring {
    position: absolute;
    inset: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    pointer-events: none;
    transform: rotate(-90deg);
}

.hh-cooldown-ring circle {
    fill: none;
    stroke: var(--hh-primary);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.1s linear;
}

.hh-like-btn.cooldown .hh-cooldown-ring circle {
    stroke: var(--hh-success);
}

.hh-pass-btn.cooldown .hh-cooldown-ring circle {
    stroke: var(--hh-danger);
}

.hh-cooldown-label {
    text-align: center;
    font-size: 0.75rem;
    color: var(--hh-text-muted);
    font-weight: 500;
    letter-spacing: 0.03em;
    padding-top: 0.25rem;
    animation: fadeIn 0.3s ease-out;
}

.hh-pass-btn {
    background: var(--hh-dark-elevated);
    border: 1px solid var(--hh-danger);
    color: var(--hh-danger);
}

.hh-pass-btn:hover:not(:disabled) {
    background: var(--hh-danger);
    color: var(--hh-text-inverse);
    transform: scale(1.05);
    box-shadow: var(--hh-shadow-md);
}

.hh-like-btn {
    background: var(--hh-dark-elevated);
    border: 1px solid var(--hh-success);
    color: var(--hh-success);
}

.hh-like-btn:hover:not(:disabled) {
    background: var(--hh-success);
    color: var(--hh-text-inverse);
    transform: scale(1.05);
    box-shadow: var(--hh-shadow-md);
}

.hh-discover-trust-note {
    margin-top: 0.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: var(--hh-text-muted);
}

.hh-why-profile-panel {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(var(--hh-security-rgb), 0.2);
    background: var(--hh-surface-soft);
}

.hh-why-profile-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--hh-text-primary);
}

.hh-why-profile-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    border: none;
    background: transparent;
    color: var(--hh-text-primary);
    padding: 0;
    cursor: pointer;
}

.hh-why-profile-panel p {
    margin: 0.45rem 0 0;
    color: var(--hh-text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.hh-ai-explanation-boundary {
    margin-top: 0.65rem;
    padding: 0.65rem 0.7rem;
    border-left: 3px solid rgba(var(--hh-security-rgb), 0.55);
    border-radius: 0.45rem;
    background: rgba(var(--hh-security-rgb), 0.07);
    color: var(--hh-text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
}

.hh-ai-explanation-boundary strong,
.hh-ai-explanation-evidence-title {
    color: var(--hh-text-primary);
    font-weight: 700;
}

.hh-ai-explanation-boundary ul {
    margin: 0.35rem 0 0;
    padding-left: 1.15rem;
}

.hh-discover-quality-feedback {
    width: 100%;
    margin-top: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(var(--hh-primary-rgb), 0.12);
    background: rgba(var(--hh-primary-rgb), 0.04);
}

.hh-discover-quality-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--hh-text-primary);
}

.hh-discover-quality-header span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hh-discover-quality-thanks {
    color: var(--hh-success);
    font-weight: 600;
    font-size: 0.74rem;
}

.hh-discover-quality-feedback p {
    margin: 0.45rem 0 0;
    color: var(--hh-text-secondary);
    font-size: 0.82rem;
}

.hh-discover-quality-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.hh-quality-btn {
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid var(--hh-glass-border);
    background: var(--hh-surface-soft-alt);
    color: var(--hh-text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.45rem 0.6rem;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.hh-quality-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.hh-quality-btn:disabled {
    cursor: not-allowed;
    opacity: 0.75;
}

.hh-quality-btn-positive.selected {
    border-color: rgba(var(--hh-success-rgb), 0.5);
    background: rgba(var(--hh-success-rgb), 0.15);
    color: hsl(145, 72%, 78%);
}

.hh-quality-btn-negative.selected {
    border-color: rgba(var(--hh-danger-rgb), 0.52);
    background: rgba(var(--hh-danger-rgb), 0.14);
    color: hsl(0, 90%, 80%);
}

/* Native dialog layer shared by match, cap, and report flows. */
dialog.hh-native-dialog.hh-match-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

dialog.hh-native-dialog.hh-match-overlay[open] {
    display: flex;
}

dialog.hh-native-dialog.hh-match-overlay::backdrop {
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.hh-match-content {
    text-align: center;
    padding: 3rem 2rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    animation: slideUpSheet 0.32s cubic-bezier(0.33, 1, 0.68, 1) forwards;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    border: 1px solid var(--hh-primary);
    box-shadow: var(--hh-shadow-lg);
    background: var(--hh-dark-elevated);
    position: relative;
    z-index: var(--hh-z-card-stack);
}

dialog.hh-native-dialog.hh-match-content {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    touch-action: auto;
}

.hh-match-content::before {
    content: '';
    display: block;
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2.5px;
    margin: 0 auto 1rem;
}

/* Profile reveal */
.hh-match-profile-reveal {
    margin-bottom: 1.5rem;
    animation: matchProfileReveal 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}

.hh-match-profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--hh-primary);
}

.hh-match-profile-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hh-primary);
    margin: 0 auto;
    font-size: 3rem;
    color: var(--hh-text-inverse);
}

@keyframes matchProfileReveal {
    from {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Confetti */
.hh-confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    background: var(--c);
    left: calc(50% + var(--x));
    border-radius: 2px;
    z-index: calc(var(--hh-z-overlay) + 1);
    animation: confettiFall var(--d) ease-in calc(var(--i) * 0.05s) forwards;
    transform: rotate(var(--r));
}

@keyframes confettiFall {
    0% {
        top: -10px;
        opacity: 1;
        transform: rotate(var(--r)) scale(1);
    }

    100% {
        top: 110vh;
        opacity: 0;
        transform: rotate(calc(var(--r) + 720deg)) scale(0.5);
    }
}

.hh-match-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--hh-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
    display: inline-block;
}

.hh-match-subtitle {
    font-size: 1.25rem;
    color: var(--hh-text-inverse);
    margin-bottom: 2.5rem;
}

.hh-match-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.hh-discover-guest {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 400px;
    margin: 2rem auto;
}

.hh-guest-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--hh-primary);
}

.hh-guest-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* ==========================================================================
   Two-Phase Discovery: Card Type Badges, Metadata Cards, Deck Progress
   ========================================================================== */

/* Deck Progress Bar */
.hh-deck-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1rem;
    padding: 0 0.25rem;
}

.hh-deck-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--hh-radius-full);
    overflow: hidden;
}

.hh-deck-progress-fill {
    height: 100%;
    background: var(--hh-gradient-primary);
    border-radius: var(--hh-radius-full);
    transition: width 0.4s ease;
}

.hh-deck-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hh-deck-count {
    font-size: 0.75rem;
    color: var(--hh-text-muted);
    white-space: nowrap;
}

.hh-deck-count-muted {
    opacity: 0.8;
}

.hh-deck-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--hh-text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.hh-deck-timer .mud-icon-root {
    font-size: 0.75rem !important;
}

.hh-match-slots {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--hh-primary);
    white-space: nowrap;
}

.hh-match-slots .mud-icon-root {
    font-size: 0.75rem !important;
}

.hh-discover-trust-strip {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 0.85rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(var(--hh-security-rgb), 0.22);
    background: var(--hh-surface-soft);
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.hh-discover-trust-strip span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    color: var(--hh-text-secondary);
}

.hh-discover-trust-strip .mud-icon-root {
    font-size: 0.8rem !important;
    color: rgba(var(--hh-security-rgb), 0.92);
}

.hh-discover-safety-nudge {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 0.75rem;
    padding: 0.68rem 0.78rem;
    border: 1px solid rgba(var(--hh-primary-rgb), 0.26);
    background: var(--hh-surface-soft);
}

.hh-discover-safety-nudge-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.hh-discover-safety-nudge-head span {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    color: var(--hh-text-primary);
    font-size: 0.79rem;
    font-weight: 700;
}

.hh-discover-safety-nudge p {
    margin: 0.45rem 0 0;
    color: var(--hh-text-secondary);
    font-size: 0.76rem;
    line-height: 1.45;
}

.hh-discover-safety-nudge-actions {
    margin-top: 0.62rem;
    display: flex;
    justify-content: flex-start;
}

.hh-discover-safety-nudge-dismiss {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 999px;
    border: 1px solid var(--hh-glass-border);
    background: transparent;
    color: var(--hh-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}


/* Card Type Badge */
.hh-card-type-badge {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: var(--hh-z-sticky);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.28rem 0.55rem;
    border-radius: var(--hh-radius-full);
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.hh-badge-picture {
    background: rgba(var(--hh-primary-rgb), 0.18);
    color: hsl(328, 90%, 65%);
    border: 1px solid rgba(var(--hh-primary-rgb), 0.3);
}

.hh-badge-metadata {
    background: rgba(var(--hh-secondary-rgb), 0.18);
    color: hsl(271, 80%, 70%);
    border: 1px solid rgba(var(--hh-secondary-rgb), 0.3);
}

.hh-card-type-badge .mud-icon-root {
    font-size: 0.875rem !important;
}

/* Metadata Card Layout */
.hh-metadata-card {
    min-height: clamp(24rem, calc(100svh - 18rem), 38rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    background: var(--hh-dark-surface);
}

.hh-profile-card.hh-metadata-card {
    touch-action: pan-y;
}

.hh-metadata-content {
    padding: 4rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    text-align: center;
}

.hh-metadata-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--hh-secondary-rgb), 0.15);
    border: 2px solid rgba(var(--hh-secondary-rgb), 0.3);
}

.hh-metadata-avatar .mud-icon-root {
    font-size: 2.5rem;
    color: hsl(271, 80%, 70%);
}

.hh-blind-personality-first {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: -0.25rem 0 0;
    color: var(--hh-text-secondary);
    font-size: 0.82rem;
}

.hh-metadata-content .hh-compat-badge {
    align-self: center;
}

.hh-metadata-content h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hh-text-muted);
    margin: 0.5rem 0 0.25rem;
}

.hh-tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hh-meta-location {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Countdown Timer */
.hh-countdown {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    border-radius: var(--hh-radius-full);
    background: rgba(var(--hh-primary-rgb), 0.1);
    border: 1px solid rgba(var(--hh-primary-rgb), 0.2);
    color: var(--hh-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.hh-countdown .mud-icon-root {
    font-size: 1rem !important;
}

/* Match Cap Warning */
.hh-cap-warning {
    border-color: var(--hh-danger) !important;
    box-shadow: 0 0 40px rgba(var(--hh-danger-rgb), 0.2) !important;
}

.hh-cap-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--hh-danger);
}

/* Picture card specific -- no fixed aspect ratio; flex fill instead */

/* ── Desktop (≥769px) ── */
@media (min-width: 769px) {
    .hh-discover {
        padding: 1rem;
        gap: 0;
    }

    .hh-deck-progress,
    .hh-discover-trust-strip,
    .hh-discover-safety-nudge,
    .hh-discover-guide {
        max-width: 400px;
    }

    .hh-card-stack {
        max-width: min(100%, 420px);
    }

    .hh-discover-guide {
        padding: 0.85rem 1rem;
    }

    .hh-discover-guide ul {
        font-size: 0.86rem;
    }

    .hh-profile-overlay {
        padding: 5rem 1.5rem 1.5rem;
    }

    .hh-profile-name {
        font-size: 1.75rem;
    }

    .hh-profile-location {
        font-size: 0.9375rem;
    }

    .hh-swipe-actions {
        gap: 2rem;
        padding: 1.5rem 0;
    }

    .hh-card-type-badge {
        top: 1rem;
        left: 1rem;
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    dialog.hh-native-dialog.hh-match-overlay[open] {
        align-items: center;
    }

    .hh-match-content {
        max-width: 400px;
        max-height: calc(100dvh - 2rem);
        margin: 1rem;
        border-radius: var(--hh-radius-xl);
        padding-bottom: 2rem;
        animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        overscroll-behavior: auto;
        touch-action: auto;
    }

    dialog.hh-native-dialog.hh-match-content {
        inset: 0;
        margin: auto;
    }

    .hh-match-content::before {
        display: none;
    }
}

/* ── Voice Intro Player ── */
.hh-voice-intro-player {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

.hh-voice-intro-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    min-height: 44px;
    border-radius: 999px;
    border: 1.5px solid var(--color-primary, #C4616C);
    background: transparent;
    color: var(--color-primary, #C4616C);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.hh-voice-intro-btn:hover {
    background: var(--color-primary, #C4616C);
    color: #fff;
}

.hh-voice-intro-btn.playing {
    background: var(--color-primary, #C4616C);
    color: #fff;
    animation: hh-voice-pulse 1.5s ease-in-out infinite;
}

@keyframes hh-voice-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Extra-small screens (<375px) ── */
@media (max-width: 374px) {
    .hh-discover {
        padding: 0.5rem;
    }

    .hh-action-btn {
        width: 52px;
        height: 52px;
    }

    .hh-swipe-actions {
        gap: 0.75rem;
        padding: 0.75rem 0 0.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hh-loading-spinner,
    .hh-profile-card.card-entering,
    .hh-profile-card.swipe-left,
    .hh-profile-card.swipe-right,
    .hh-confetti,
    .hh-match-content,
    .hh-voice-intro-btn.playing {
        animation: none !important;
        transition: none !important;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    /* The shared mobile stylesheet used to place the action row vertically.
       Discover now scrolls inside the shell, so keep the controls compact and
       predictable instead of adding another full viewport of height. */
    .hh-card-stack {
        flex-direction: column;
        min-height: 0;
    }

    .hh-swipe-actions {
        flex-direction: row;
        padding: 0.75rem 0;
        gap: 1.25rem;
    }
}
