/* ===== Общие кнопки (используются randomModal и фильтрами каталога) ===== */
.filterBtn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.filterBtnGhost {
    background: transparent;
    border: 2px solid #2A2A2A;
    color: #B0B0B4;
}

.filterBtnGhost:hover {
    border-color: #4A4A4E;
    color: #FBFBFB;
}

.filterBtnPrimary {
    background: linear-gradient(135deg, rgba(85, 173, 255, 1) 0%, rgba(2, 133, 253, 1) 100%);
    color: #fff;
}

.filterBtnPrimary:hover {
    opacity: 0.9;
}

/* ===== Search bar ===== */
#searchBar {
    background: #161616;
    color: #FBFBFB;
    border: 2px solid #1F1F1F;
    position: fixed;
    top: 48px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: 90%;
    max-width: 560px;
    padding: 16px 20px;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    border-radius: 16px;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

#searchBar.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

#searchTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

#searchTop h3 {
    font-size: 16px;
    font-weight: 500;
}

#searchTop .material-icons-round {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    color: #4A4A4E;
    flex-shrink: 0;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

#searchTop .material-icons-round:hover {
    background: #1F1F1F;
    color: #FBFBFB;
}

#searchBarInputWrap {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #191919;
    border-radius: 8px;
    padding: 0 14px;
    height: 42px;
}

#searchBarInputWrap .material-icons-round {
    font-size: 18px;
    color: #4A4A4E;
    flex-shrink: 0;
}

#searchBarInput {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #FBFBFB;
    font-size: 14px;
    font-family: inherit;
}

#searchBarInput::placeholder {
    color: #4A4A4E;
}

#searchResults {
    margin-top: 14px;
    max-height: 360px;
    overflow-y: auto;
}

.searchResultItem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #FBFBFB;
    transition: background 0.15s ease;
}

.searchResultItem:hover {
    background: #1F1F1F;
}

.searchResultCover {
    width: 40px;
    height: 56px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(74, 74, 78, 1) 25%, rgba(122, 122, 126, 1) 75%);
}

.searchResultInfo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.searchResultTitle {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.searchResultMeta {
    font-size: 12px;
    color: #7A7A7E;
}

#searchEmptyState,
#searchLoading {
    display: none;
    padding: 16px 8px;
    color: #7A7A7E;
    font-size: 14px;
    text-align: center;
}

/* ===== Random modal (рулетка) ===== */
#randomModal {
    background: #161616;
    color: #FBFBFB;
    border: 2px solid #1F1F1F;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 90%;
    max-width: 480px;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    border-radius: 16px;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

#randomModal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

#randomTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

#randomTop h3 {
    font-size: 16px;
    font-weight: 500;
}

#randomTop .material-icons-round {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    color: #4A4A4E;
    flex-shrink: 0;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

#randomTop .material-icons-round:hover {
    background: #1F1F1F;
    color: #FBFBFB;
}

#randomReel {
    position: relative;
    height: 280px;
    overflow: hidden;
    border-radius: 12px;
    background: #101010;
}

#randomReel::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 150px;
    transform: translateX(-50%);
    border: 3px solid #DF4C03;
    border-radius: 12px;
    z-index: 3;
    pointer-events: none;
}

#randomReel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #101010 0%, transparent 15%, transparent 85%, #101010 100%);
    z-index: 2;
    pointer-events: none;
}

#randomStrip {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    will-change: transform;
}

.reelCard {
    width: 150px;
    height: 240px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, rgba(74, 74, 78, 1) 25%, rgba(122, 122, 126, 1) 75%);
}

.reelCard img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#randomResult {
    margin-top: 18px;
    display: none;
}

#randomResult.visible {
    display: block;
}

#randomResultTitle {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 6px;
}

#randomResultMeta {
    font-size: 13px;
    color: #7A7A7E;
    margin-bottom: 10px;
}

#randomResultDescription {
    font-size: 13px;
    color: #B0B0B4;
    line-height: 1.5;
    max-height: 76px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    margin-bottom: 16px;
}

#randomActions {
    display: flex;
    gap: 10px;
}

#randomActions .filterBtn {
    flex: 1;
    text-align: center;
}

#randomWatchLink {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

#randomLoadingState {
    display: none;
    align-items: center;
    justify-content: center;
    height: 280px;
    color: #7A7A7E;
    font-size: 14px;
}

#randomLoadingState.visible {
    display: none;
}

@media (max-width: 768px) {
    #searchBar {
        top: 16px;
        width: calc(100% - 32px);
        max-width: none;
        padding: 14px;
    }

    #randomModal {
        width: calc(100% - 32px);
        max-width: none;
        padding: 16px;
    }

    #randomReel {
        height: 220px;
    }

    .reelCard {
        width: 120px;
        height: 190px;
    }

    #randomReel::before {
        width: 120px;
    }

    #randomActions {
        flex-direction: column;
    }
}

/* ===== Alpha version notice ===== */
#alphaNoticeOverlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#alphaNoticeOverlay.visible {
    opacity: 1;
    visibility: visible;
}

#alphaNoticeBox {
    background: #161616;
    border: 2px solid #1F1F1F;
    border-radius: 16px;
    padding: 28px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

#alphaNoticeOverlay.visible #alphaNoticeBox {
    transform: scale(1);
}

#alphaNoticeIcon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #DF4C03 0%, #B23A02 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

#alphaNoticeIcon .material-icons-round {
    font-size: 26px;
    color: #fff;
}

#alphaNoticeBox h3 {
    color: #FBFBFB;
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 10px;
}

#alphaNoticeBox p {
    color: #B0B0B4;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

#alphaNoticeCloseBtn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, rgba(85, 173, 255, 1) 0%, rgba(2, 133, 253, 1) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

#alphaNoticeCloseBtn:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    #alphaNoticeBox {
        padding: 22px;
    }
}