/* Compact, mobile-first location preview for the treasure map. */
.leaflet-popup-content-wrapper {
    overflow: hidden;
    border-radius: 1rem !important;
}

.leaflet-popup-content {
    width: min(72vw, 18rem) !important;
    max-height: min(54dvh, 25rem) !important;
    margin: 0 !important;
    overflow-y: auto;
    scrollbar-width: thin;
}

.popup-card {
    min-width: 0;
    background: #fff;
}

.popup-img,
.popup-carousel {
    width: 100% !important;
    height: 6.5rem !important;
    min-height: 0 !important;
    aspect-ratio: auto;
}

.popup-img,
.carousel-img {
    object-fit: cover;
}

.popup-info {
    padding: 0.75rem !important;
}

.popup-title {
    margin: 0 2.1rem 0.35rem 0 !important;
    font-size: 0.98rem !important;
    line-height: 1.35;
}

.popup-status {
    margin: 0 0 0.35rem !important;
    padding: 0.25rem 0.65rem !important;
    font-size: 0.72rem !important;
    line-height: 1.25;
}

.popup-distance {
    margin: 0.35rem 0 !important;
    font-size: 0.74rem !important;
}

.popup-hint {
    display: -webkit-box;
    margin: 0.45rem 0 !important;
    overflow: hidden;
    color: #475569 !important;
    font-size: 0.76rem !important;
    line-height: 1.45 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.popup-extra {
    margin-top: 0.45rem;
    border: 1px solid #dbe7f3;
    border-radius: 0.75rem;
    background: #f7faff;
}

.popup-extra summary {
    display: flex;
    min-height: 2.5rem;
    padding: 0.55rem 0.7rem;
    align-items: center;
    gap: 0.45rem;
    color: #285d8f;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    touch-action: manipulation;
}

.popup-extra summary::-webkit-details-marker {
    display: none;
}

.popup-extra summary::after {
    margin-left: auto;
    content: "+";
    font-size: 1rem;
}

.popup-extra[open] summary::after {
    content: "?";
}

.popup-extra-content {
    max-height: 7.5rem;
    padding: 0 0.7rem 0.65rem;
    overflow-y: auto;
    border-top: 1px solid #e4edf6;
}

.popup-extra-content p,
.popup-extra-content div,
.popup-extra-content strong,
.popup-extra-content li {
    font-size: 0.7rem !important;
    line-height: 1.45 !important;
}

.popup-extra-content p,
.popup-extra-content div {
    margin: 0.45rem 0 !important;
}

.popup-extra-content ul {
    margin: 0.3rem 0 !important;
    padding-left: 1.1rem !important;
}

.btn-navigate {
    min-height: 2.75rem !important;
    margin-top: 0.55rem !important;
    padding: 0.55rem 0.75rem !important;
    border-radius: 0.75rem !important;
    font-size: 0.82rem !important;
}

.carousel-btn {
    width: 2.25rem !important;
    height: 2.25rem !important;
}

.carousel-dots {
    bottom: 0.45rem !important;
}

.leaflet-popup-close-button {
    top: 0.35rem !important;
    right: 0.35rem !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
    font-size: 1.2rem !important;
}

@media (min-width: 48rem) {
    .leaflet-popup-content {
        width: min(34rem, 74vw) !important;
        max-height: min(68dvh, 34rem) !important;
    }

    .popup-card {
        display: grid !important;
        grid-template-columns: minmax(11rem, 42%) minmax(0, 1fr);
        align-items: stretch;
    }

    .popup-img,
    .popup-carousel {
        width: 100% !important;
        height: 100% !important;
        min-height: 16rem !important;
    }

    .popup-info {
        padding: 1rem !important;
    }

    .popup-hint {
        -webkit-line-clamp: 3;
    }
}

@media (max-height: 42rem) {
    .popup-img,
    .popup-carousel {
        height: 5rem !important;
    }

    .leaflet-popup-content {
        max-height: 48dvh !important;
    }
}


.popup-status.nearby {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.popup-card--mystery {
    overflow: hidden;
    background: linear-gradient(180deg, #f7f3ff 0%, #fff 72%);
}

.popup-mystery-visual {
    position: relative;
    display: grid;
    min-height: 7rem;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 35%, rgba(196, 181, 253, 0.85), transparent 34%),
        linear-gradient(135deg, #312e81, #6d28d9 58%, #9333ea);
}

.popup-mystery-mark {
    display: grid;
    width: 4rem;
    height: 4rem;
    place-items: center;
    border: 0.18rem solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 1.5rem rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
}

.popup-mystery-spark {
    position: absolute;
    color: #fde68a;
    font-size: 1rem;
}

.popup-mystery-spark--one {
    top: 1rem;
    left: 22%;
}

.popup-mystery-spark--two {
    right: 20%;
    bottom: 1.1rem;
}

.popup-hint--mystery {
    display: block;
    -webkit-line-clamp: unset;
    color: #5b4b73 !important;
}