/* ==========================================================================
   Case picker modal (landing page)
   ========================================================================== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--overlay);
}

.modal-window {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1001;
    flex-direction: column;
    width: min(860px, calc(100% - 32px));
    max-height: 85vh;
    overflow: hidden;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-pop);
    transform: translate(-50%, -50%);
}

.modal-overlay.modal-active {
    display: block;
    animation: modal-fade 160ms var(--ease);
}

.modal-window.modal-active {
    display: flex;
    animation: modal-in 180ms var(--ease);
}

@keyframes modal-fade {
    from { opacity: 0; }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 8px)) scale(0.98);
    }
}

.modal-header {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 14px var(--sp-4) 14px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-header h3 {
    font-size: var(--fs-md);
    font-weight: 600;
}

.modal-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.zbll-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 20px;
    overflow-y: auto;
}

.zbllItem {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    padding: 10px 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    background: var(--surface-2);
    cursor: pointer;
    transition: background-color var(--dur) var(--ease);
}

.zbllItem:hover {
    background: var(--surface-3);
}

.zbllItem img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

.zbllItem.selected {
    outline: 2px solid var(--good);
    outline-offset: -2px;
}

.zbllItem.selected::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--good)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
        center / 10px no-repeat;
}

.zbll-item-heatmap-badge {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font: 600 10px var(--font-mono);
    white-space: nowrap;
    pointer-events: none;
}

.zbll-item-no-data {
    color: var(--text-3);
}

@media (max-width: 600px) {
    .modal-header {
        flex-wrap: wrap;
        padding: 12px var(--sp-3) 12px var(--sp-4);
    }

    .zbll-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: var(--sp-3);
    }
}
