/* Very Good Encounter Builder — monster browser: search, CR range, breadcrumb, menu grid */

.eb-find { margin-top: 4px; }   /* same rhythm as the collapsible sections above */

/* ── Search ── */
.eb-search {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    font-size: 0.9rem;
    min-height: 40px;
    margin-bottom: 10px;
}

.eb-search::placeholder { color: var(--text-muted); }
.eb-search:focus { outline: 2px solid #95a5a6; outline-offset: 1px; }

/* ── CR range (two stacked range inputs; only the thumbs take pointer events) ── */
.eb-cr-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.eb-cr-readout {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-warning);
}

.eb-cr-slider {
    position: relative;
    height: 28px;
    margin: 2px 0 6px;
}

.eb-cr-slider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    border-radius: 2px;
    background: var(--bg-tertiary);
}

.eb-cr-slider input[type="range"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.eb-cr-slider input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 28px; }
.eb-cr-slider input[type="range"]::-moz-range-track { background: transparent; height: 28px; }

.eb-cr-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 20px;
    height: 20px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--accent-warning);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
}

.eb-cr-slider input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-warning);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
}

.eb-cr-slider input[type="range"]:focus-visible { outline: none; }
.eb-cr-slider input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid #fff; }

#eb-cr-presets { margin-bottom: 12px; }

/* ── Breadcrumb ── */
.eb-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    min-height: 40px;
}

.eb-breadcrumb-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 8px;
    min-height: 40px;   /* larger tap target; text stays a plain underlined link */
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.eb-breadcrumb-link:hover { color: var(--text-primary); }
.eb-breadcrumb-current { color: var(--text-primary); font-weight: 600; padding: 0 8px; }

/* ── Menu grid (categories, families, monsters, search results) ── */
.eb-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 4px;
}

.eb-menu-btn { justify-content: space-between; gap: 6px; text-align: left; padding: 5px 12px; min-height: 44px; }
.eb-menu-btn.is-empty { opacity: 0.35; }
.eb-menu-count { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }

.eb-monster-btn {
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    padding: 5px 12px;            /* text inset matches search box and source rows */
    min-height: 44px;             /* two-line meta: one even row height */
    grid-column: 1 / -1;          /* monsters list one per row */
}

.eb-monster-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb-monster-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex-shrink: 0; line-height: 1.2; }
.eb-monster-cr { font-size: 0.72rem; color: var(--text-muted); }
.eb-monster-diff { font-size: 0.68rem; font-weight: 600; }
.eb-monster-flag { color: var(--accent-warning); font-size: 0.7rem; flex-shrink: 0; }
.eb-monster-added { color: var(--accent-warning); font-size: 0.72rem; font-weight: 600; flex-shrink: 0; }

.eb-menu-empty {
    border: 1.5px dashed rgba(255,255,255,0.12);
    border-radius: var(--border-radius);
    padding: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
