.discovery-search {
    width: min(1680px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 14px;
    color: #f5f8ff;
}

.discovery-hero {
    min-height: 220px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
    gap: clamp(18px, 3vw, 34px);
    align-items: end;
    padding: clamp(18px, 4vw, 40px);
    border: 1px solid rgba(0, 245, 255, 0.24);
    border-radius: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 0, 255, 0.22), transparent 38%),
        radial-gradient(circle at 88% 28%, rgba(0, 255, 159, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(6, 10, 24, 0.96), rgba(4, 18, 28, 0.88));
    box-shadow:
        0 26px 58px rgba(0, 0, 0, 0.44),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.discovery-eyebrow {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 159, 0.36);
    background: rgba(0, 255, 159, 0.08);
    color: #8dffd6;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.discovery-hero h1 {
    max-width: 920px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.15rem, 4.8vw, 5.6rem);
    line-height: 0.96;
    letter-spacing: 0;
}

.discovery-hero p {
    max-width: 760px;
    margin: 14px 0 0;
    color: rgba(229, 241, 255, 0.8);
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    line-height: 1.55;
}

.discovery-hero__stats {
    display: grid;
    gap: 10px;
}

.discovery-hero__stats span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(1, 5, 12, 0.52);
    color: rgba(222, 236, 255, 0.78);
}

.discovery-hero__stats strong {
    color: #ffffff;
    font-size: 1.25rem;
}

.discovery-command {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(170px, 210px) minmax(170px, 230px) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    background: rgba(4, 8, 17, 0.84);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.discovery-command label,
.discovery-panel label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.discovery-command span,
.discovery-panel label span {
    color: rgba(161, 244, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.discovery-command input,
.discovery-command select,
.discovery-panel input {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(0, 245, 255, 0.22);
    background: rgba(0, 0, 0, 0.4);
    color: #f8fbff;
    padding: 0 13px;
    font: inherit;
}

.discovery-command input:focus,
.discovery-command select:focus,
.discovery-panel input:focus {
    border-color: rgba(255, 0, 255, 0.56);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 0, 255, 0.14), 0 0 22px rgba(0, 245, 255, 0.12);
}

.discovery-command button,
.discovery-more {
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(110deg, #7c5cff, #ff3fb7 52%, #00e5ff);
    color: #ffffff;
    padding: 0 20px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(255, 0, 255, 0.22);
}

.discovery-filter-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.discovery-filter-strip::-webkit-scrollbar {
    display: none;
}

.discovery-filter-strip button,
.discovery-chips button,
.discovery-history button {
    border: 1px solid rgba(0, 255, 159, 0.26);
    border-radius: 999px;
    background: rgba(0, 255, 159, 0.08);
    color: #ddfff2;
    min-height: 38px;
    padding: 0 13px;
    font-weight: 850;
    cursor: pointer;
    white-space: nowrap;
}

.discovery-layout {
    display: grid;
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.discovery-side,
.discovery-results {
    min-width: 0;
}

.discovery-side {
    display: grid;
    gap: 12px;
    position: sticky;
    top: 8px;
}

.discovery-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(0, 245, 255, 0.18);
    background:
        linear-gradient(155deg, rgba(0, 255, 159, 0.08), rgba(255, 0, 255, 0.06)),
        rgba(4, 8, 17, 0.86);
}

.discovery-panel h2 {
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
}

.discovery-chips,
.discovery-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(226, 239, 255, 0.7);
}

.discovery-history {
    display: grid;
}

.discovery-history button {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border-radius: 14px;
    min-height: 42px;
}

.discovery-history small {
    color: rgba(255, 255, 255, 0.58);
}

.discovery-age-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.discovery-results {
    display: grid;
    gap: 12px;
}

.discovery-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.discovery-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.1);
    color: rgba(237, 245, 255, 0.78);
}

.discovery-group strong {
    color: #ffffff;
}

.discovery-state {
    min-height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1px solid rgba(0, 245, 255, 0.2);
    background: rgba(0, 0, 0, 0.34);
    color: rgba(233, 244, 255, 0.82);
}

.discovery-state[hidden] {
    display: none;
}

.discovery-state.is-busy {
    color: #8dffd6;
}

.discovery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.discovery-card {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(4, 8, 17, 0.88);
    color: #f8fbff;
    text-decoration: none;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.discovery-card:hover,
.discovery-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(0, 255, 159, 0.44);
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.42), 0 0 24px rgba(0, 255, 159, 0.14);
    outline: none;
}

.discovery-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: rgba(0, 0, 0, 0.42);
}

.discovery-card__media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.discovery-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.58));
}

.discovery-card__badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 1;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.discovery-card__body {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.discovery-card__head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.discovery-card__head img {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(0, 255, 159, 0.34);
}

.discovery-card__head strong,
.discovery-card__head small,
.discovery-card__desc {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discovery-card__head strong {
    display: block;
    white-space: nowrap;
    color: #ffffff;
    font-size: 0.98rem;
}

.discovery-card__head small {
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    color: rgba(211, 228, 247, 0.68);
    font-size: 0.76rem;
}

.discovery-card__desc {
    color: rgba(229, 241, 255, 0.76);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.discovery-card__tags,
.discovery-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.discovery-card__tags span,
.discovery-card__metrics span {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.discovery-card__tags span {
    border: 1px solid rgba(0, 245, 255, 0.24);
    color: #a5f7ff;
    background: rgba(0, 245, 255, 0.08);
}

.discovery-card__metrics span {
    border: 1px solid rgba(255, 0, 255, 0.22);
    color: #ffd8fb;
    background: rgba(255, 0, 255, 0.08);
}

.discovery-card--live .discovery-card__badge {
    border-color: rgba(255, 43, 124, 0.52);
    background: rgba(255, 43, 124, 0.24);
}

.discovery-card--shadowmatch .discovery-card__badge {
    border-color: rgba(255, 88, 205, 0.52);
    background: rgba(255, 88, 205, 0.2);
}

.discovery-more {
    width: fit-content;
    justify-self: center;
}

@media (max-width: 1180px) {
    .discovery-command {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .discovery-command button {
        grid-column: 1 / -1;
    }

    .discovery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .discovery-hero,
    .discovery-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .discovery-side {
        position: static;
        order: 2;
    }

    .discovery-results {
        order: 1;
    }
}

@media (max-width: 620px) {
    .discovery-search {
        gap: 10px;
    }

    .discovery-hero {
        min-height: 0;
        padding: 18px;
        border-radius: 18px;
    }

    .discovery-hero h1 {
        font-size: clamp(2rem, 11vw, 3rem);
    }

    .discovery-command {
        grid-template-columns: minmax(0, 1fr);
        border-radius: 16px;
    }

    .discovery-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .discovery-card__media {
        aspect-ratio: 16 / 9;
    }
}
